Skip to contentSkip to conversation

Why does ceph-osd not daemonize in ceph-disk

DISCUSSION Willem Jan Withagen 3 participants 9 messages Nov 11, 2016 – Nov 16, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

As one of the last steps to complete my first run op porting I need to get ceph-disk working...
But I'm getting a stall in test_activate for the OSD. why doesn't the activation of the OSD background and the script continues.

--WjW

During testing is starts ceph-osd like:

function test_activate() {
    local to_prepare=$1
    local to_activate=$2
    local osd_uuid=$($uuidgen)

    ${CEPH_DISK} $CEPH_DISK_ARGS \
        prepare --osd-uuid $osd_uuid $to_prepare || return 1

    $timeout $TIMEOUT ${CEPH_DISK} $CEPH_DISK_ARGS \
        activate \
        --mark-init=none \
        $to_activate || return 1

    test_pool_read_write $osd_uuid || return 1
}

Which results in script output:

activate: ceph osd.0 data dir is ready at testdir/test-ceph-disk/dir
command_check_call: Running command_check: ../build/bin/ceph-osd --cluster=ceph --id=0 --osd-data=testdir/test-ceph-disk/dir --osd-journal=testdir/test-ceph-disk/dir/journal
starting osd.0 at - osd_data testdir/test-ceph-disk/dir testdir/test-ceph-disk/dir/journal

And is the processtable this looks like:

/usr/bin/timeout 360 /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage run --append --source=ceph_disk -- /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk --verbose --prepend-to-path= --statedir=testdir/test-ceph-disk --sysconfdir=testdir/test-ceph-disk activate --mark-init=none testdir/test-ceph-disk/dir

and:

CEPH_BIN=/usr/srcs/Ceph/work/ceph/build/bin
CEPH_ROOT=/usr/srcs/Ceph/work/ceph CEPH_CONF=/dev/null
LD_LIBRARY_PATH=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_BUILD_VIRTUALENV=/tmp
VIRTUAL_ENV=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27 PATH=/tmp/ceph-disk-virtualenv/bin:/tmp/ceph-detect-init-virtualenv/bin:.:../build/bin:/usr/srcs/Ceph/work/ceph/build/bin:.:/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin:/tmp/ceph-disk-virtualenv/bin:/home/wjw/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:.:/usr/srcs/Ceph/work/ceph/build/bin:/usr/srcs/Ceph/work/ceph/src PYTHONHASHSEED=648437795 CEPH_LIB=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_DISK=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage
run --append --source=ceph_disk --
/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk
PWD=/usr/srcs/Ceph/work/ceph/build CEPH_ARGS=
--fsid=19836d4d-ad32-429e-bf30-588f9d8d18d1 --auth-supported=none
--mon-host=127.0.0.1:7451 --chdir= --journal-dio=false
--erasure-code-dir=/usr/srcs/Ceph/work/ceph/build/lib
--plugin-dir=/usr/srcs/Ceph/work/ceph/build/lib
--log-file=testdir/test-ceph-disk/$name.log
--pid-file=testdir/test-ceph-disk/$name.pidfile
--osd-class-dir=/usr/srcs/Ceph/work/ceph/build/lib
--run-dir=testdir/test-ceph-disk --osd-failsafe-full-ratio=.99
--osd-journal-size=100 --debug-osd=20 --debug-bdev=20
--debug-bluestore=20 --osd-max-object-name-len=460
--osd-max-object-namespace-len=64 SHLVL=1 CEPH_MON=127.0.0.1:7451
_=/usr/bin/timeout ../build/bin/ceph-osd --cluster=ceph --id=0
--osd-data=testdir/test-ceph-disk/dir
--osd-journal=testdir/test-ceph-disk/dir/journal

And is the osd.0.log I see:

2016-11-11 13:41:36.562422 b678000  2 osd.0 0 boot
2016-11-11 13:41:36.614480 b678000  0 osd.0 0 done with init, starting
boot process
2016-11-11 13:41:36.614532 b678000  1 osd.0 0 We are healthy, booting
2016-11-11 13:41:36.614535 b678000 10 osd.0 0 start_boot - have maps 0..0
2016-11-11 13:41:36.616877 ba89b00 10 osd.0 0 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618842 b7d6d80 10 osd.0 5 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618846 b7d6d80 10 osd.0 5 _send_boot
2016-11-11 13:41:36.724501 b7d6d80 10 osd.0 6 boot_epoch is 6
2016-11-11 13:41:36.724505 b7d6d80  1 osd.0 6 state: booting -> active

So the OSD should actually finish and go into background. But the command stalls, and aborts after the shell timeout.

#1 lore raw

Hi,

FYI when the init system is unknown, it runs ceph-osd directly instead of delegating to the init system.

https://github.com/ceph/ceph/blob/master/src/ceph-disk/ceph_disk/main.py#L3468

The reason why it does not daemonize is unclear to me.

Cheers

Quoted 95 lines · Willem Jan Withagen

Hi,

As one of the last steps to complete my first run op porting I need to get ceph-disk working...
But I'm getting a stall in test_activate for the OSD. why doesn't the activation of the OSD background and the script continues.

--WjW

During testing is starts ceph-osd like:

function test_activate() {
    local to_prepare=$1
    local to_activate=$2
    local osd_uuid=$($uuidgen)

    ${CEPH_DISK} $CEPH_DISK_ARGS \
        prepare --osd-uuid $osd_uuid $to_prepare || return 1

    $timeout $TIMEOUT ${CEPH_DISK} $CEPH_DISK_ARGS \
        activate \
        --mark-init=none \
        $to_activate || return 1

    test_pool_read_write $osd_uuid || return 1
}

Which results in script output:

activate: ceph osd.0 data dir is ready at testdir/test-ceph-disk/dir
command_check_call: Running command_check: ../build/bin/ceph-osd --cluster=ceph --id=0 --osd-data=testdir/test-ceph-disk/dir --osd-journal=testdir/test-ceph-disk/dir/journal
starting osd.0 at - osd_data testdir/test-ceph-disk/dir testdir/test-ceph-disk/dir/journal

And is the processtable this looks like:

/usr/bin/timeout 360 /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage run --append --source=ceph_disk -- /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk --verbose --prepend-to-path= --statedir=testdir/test-ceph-disk --sysconfdir=testdir/test-ceph-disk activate --mark-init=none testdir/test-ceph-disk/dir

and:

CEPH_BIN=/usr/srcs/Ceph/work/ceph/build/bin
CEPH_ROOT=/usr/srcs/Ceph/work/ceph CEPH_CONF=/dev/null
LD_LIBRARY_PATH=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_BUILD_VIRTUALENV=/tmp
VIRTUAL_ENV=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27 PATH=/tmp/ceph-disk-virtualenv/bin:/tmp/ceph-detect-init-virtualenv/bin:.:../build/bin:/usr/srcs/Ceph/work/ceph/build/bin:.:/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin:/tmp/ceph-disk-virtualenv/bin:/home/wjw/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:.:/usr/srcs/Ceph/work/ceph/build/bin:/usr/srcs/Ceph/work/ceph/src PYTHONHASHSEED=648437795 CEPH_LIB=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_DISK=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage
run --append --source=ceph_disk --
/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk
PWD=/usr/srcs/Ceph/work/ceph/build CEPH_ARGS=
--fsid=19836d4d-ad32-429e-bf30-588f9d8d18d1 --auth-supported=none
--mon-host=127.0.0.1:7451 --chdir= --journal-dio=false
--erasure-code-dir=/usr/srcs/Ceph/work/ceph/build/lib
--plugin-dir=/usr/srcs/Ceph/work/ceph/build/lib
--log-file=testdir/test-ceph-disk/$name.log
--pid-file=testdir/test-ceph-disk/$name.pidfile
--osd-class-dir=/usr/srcs/Ceph/work/ceph/build/lib
--run-dir=testdir/test-ceph-disk --osd-failsafe-full-ratio=.99
--osd-journal-size=100 --debug-osd=20 --debug-bdev=20
--debug-bluestore=20 --osd-max-object-name-len=460
--osd-max-object-namespace-len=64 SHLVL=1 CEPH_MON=127.0.0.1:7451
_=/usr/bin/timeout ../build/bin/ceph-osd --cluster=ceph --id=0
--osd-data=testdir/test-ceph-disk/dir
--osd-journal=testdir/test-ceph-disk/dir/journal

And is the osd.0.log I see:

2016-11-11 13:41:36.562422 b678000  2 osd.0 0 boot
2016-11-11 13:41:36.614480 b678000  0 osd.0 0 done with init, starting
boot process
2016-11-11 13:41:36.614532 b678000  1 osd.0 0 We are healthy, booting
2016-11-11 13:41:36.614535 b678000 10 osd.0 0 start_boot - have maps 0..0
2016-11-11 13:41:36.616877 ba89b00 10 osd.0 0 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618842 b7d6d80 10 osd.0 5 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618846 b7d6d80 10 osd.0 5 _send_boot
2016-11-11 13:41:36.724501 b7d6d80 10 osd.0 6 boot_epoch is 6
2016-11-11 13:41:36.724505 b7d6d80  1 osd.0 6 state: booting -> active

So the OSD should actually finish and go into background. But the command stalls, and aborts after the shell timeout. --
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
#2 lore raw
Quoted 7 lines · Loic Dachary

Hi,

FYI when the init system is unknown, it runs ceph-osd directly instead of delegating to the init system.

https://github.com/ceph/ceph/blob/master/src/ceph-disk/ceph_disk/main.py#L3468

The reason why it does not daemonize is unclear to me.

Does ceph-osd daemonize if you run it manually from the command line?

s

Quoted 108 lines

Cheers

Quoted 95 lines · Willem Jan Withagen

Hi,

As one of the last steps to complete my first run op porting I need to get ceph-disk working...
But I'm getting a stall in test_activate for the OSD. why doesn't the activation of the OSD background and the script continues.

--WjW

During testing is starts ceph-osd like:

function test_activate() {
    local to_prepare=$1
    local to_activate=$2
    local osd_uuid=$($uuidgen)

    ${CEPH_DISK} $CEPH_DISK_ARGS \
        prepare --osd-uuid $osd_uuid $to_prepare || return 1

    $timeout $TIMEOUT ${CEPH_DISK} $CEPH_DISK_ARGS \
        activate \
        --mark-init=none \
        $to_activate || return 1

    test_pool_read_write $osd_uuid || return 1
}

Which results in script output:

activate: ceph osd.0 data dir is ready at testdir/test-ceph-disk/dir
command_check_call: Running command_check: ../build/bin/ceph-osd --cluster=ceph --id=0 --osd-data=testdir/test-ceph-disk/dir --osd-journal=testdir/test-ceph-disk/dir/journal
starting osd.0 at - osd_data testdir/test-ceph-disk/dir testdir/test-ceph-disk/dir/journal

And is the processtable this looks like:

/usr/bin/timeout 360 /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage run --append --source=ceph_disk -- /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk --verbose --prepend-to-path= --statedir=testdir/test-ceph-disk --sysconfdir=testdir/test-ceph-disk activate --mark-init=none testdir/test-ceph-disk/dir

and:

CEPH_BIN=/usr/srcs/Ceph/work/ceph/build/bin
CEPH_ROOT=/usr/srcs/Ceph/work/ceph CEPH_CONF=/dev/null
LD_LIBRARY_PATH=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_BUILD_VIRTUALENV=/tmp
VIRTUAL_ENV=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27 PATH=/tmp/ceph-disk-virtualenv/bin:/tmp/ceph-detect-init-virtualenv/bin:.:../build/bin:/usr/srcs/Ceph/work/ceph/build/bin:.:/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin:/tmp/ceph-disk-virtualenv/bin:/home/wjw/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:.:/usr/srcs/Ceph/work/ceph/build/bin:/usr/srcs/Ceph/work/ceph/src PYTHONHASHSEED=648437795 CEPH_LIB=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_DISK=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage
run --append --source=ceph_disk --
/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk
PWD=/usr/srcs/Ceph/work/ceph/build CEPH_ARGS=
--fsid=19836d4d-ad32-429e-bf30-588f9d8d18d1 --auth-supported=none
--mon-host=127.0.0.1:7451 --chdir= --journal-dio=false
--erasure-code-dir=/usr/srcs/Ceph/work/ceph/build/lib
--plugin-dir=/usr/srcs/Ceph/work/ceph/build/lib
--log-file=testdir/test-ceph-disk/$name.log
--pid-file=testdir/test-ceph-disk/$name.pidfile
--osd-class-dir=/usr/srcs/Ceph/work/ceph/build/lib
--run-dir=testdir/test-ceph-disk --osd-failsafe-full-ratio=.99
--osd-journal-size=100 --debug-osd=20 --debug-bdev=20
--debug-bluestore=20 --osd-max-object-name-len=460
--osd-max-object-namespace-len=64 SHLVL=1 CEPH_MON=127.0.0.1:7451
_=/usr/bin/timeout ../build/bin/ceph-osd --cluster=ceph --id=0
--osd-data=testdir/test-ceph-disk/dir
--osd-journal=testdir/test-ceph-disk/dir/journal

And is the osd.0.log I see:

2016-11-11 13:41:36.562422 b678000  2 osd.0 0 boot
2016-11-11 13:41:36.614480 b678000  0 osd.0 0 done with init, starting
boot process
2016-11-11 13:41:36.614532 b678000  1 osd.0 0 We are healthy, booting
2016-11-11 13:41:36.614535 b678000 10 osd.0 0 start_boot - have maps 0..0
2016-11-11 13:41:36.616877 ba89b00 10 osd.0 0 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618842 b7d6d80 10 osd.0 5 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618846 b7d6d80 10 osd.0 5 _send_boot
2016-11-11 13:41:36.724501 b7d6d80 10 osd.0 6 boot_epoch is 6
2016-11-11 13:41:36.724505 b7d6d80  1 osd.0 6 state: booting -> active

So the OSD should actually finish and go into background. But the command stalls, and aborts after the shell timeout. --
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Loïc Dachary, Artisan Logiciel Libre
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
Quoted 10 lines · Sage Weil
Quoted 7 lines · Loic Dachary

Hi,

FYI when the init system is unknown, it runs ceph-osd directly instead of delegating to the init system.

https://github.com/ceph/ceph/blob/master/src/ceph-disk/ceph_disk/main.py#L3468

The reason why it does not daemonize is unclear to me.

Does ceph-osd daemonize if you run it manually from the command line?

Yup,

created a small wrapper to see what happened in there, and I actually see the wrapper exiting. Only this happy event does not make it thru to the python friends. :( And after 360 sec timeout kills the lot.

--WjW

#4 lore raw
Quoted 10 lines · Willem Jan Withagen
Quoted 9 lines · Sage Weil
Quoted 7 lines · Loic Dachary

Hi,

FYI when the init system is unknown, it runs ceph-osd directly instead of delegating to the init system.

https://github.com/ceph/ceph/blob/master/src/ceph-disk/ceph_disk/main.py#L3468

The reason why it does not daemonize is unclear to me.

Quoted 7 lines
Quoted 1 line

Does ceph-osd daemonize if you run it manually from the command line?

Yup,

created a small wrapper to see what happened in there, and I actually see the wrapper exiting. Only this happy event does not make it thru to the python friends. :( And after 360 sec timeout kills the lot.

Couldy you show the command line you're using to manually run the OSD ? I suspect the arguments are not the same: the python script populates the CEPH_ARGS environment variable.

Just a thought ;-)

Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
#5 lore raw
Quoted 17 lines · Loic Dachary
Quoted 14 lines · Willem Jan Withagen
Quoted 10 lines · Sage Weil
Quoted 7 lines · Loic Dachary

Hi,

FYI when the init system is unknown, it runs ceph-osd directly instead of delegating to the init system.

https://github.com/ceph/ceph/blob/master/src/ceph-disk/ceph_disk/main.py#L3468

The reason why it does not daemonize is unclear to me.

Does ceph-osd daemonize if you run it manually from the command line?

Yup,

Quoted 7 lines
Quoted 3 lines

created a small wrapper to see what happened in there, and I actually see the wrapper exiting. Only this happy event does not make it thru to the python friends. :( And after 360 sec timeout kills the lot.

Couldy you show the command line you're using to manually run the OSD ? I suspect the arguments are not the same: the python script populates the CEPH_ARGS environment variable.

Just a thought ;-)

Hi Loic,

Yup, there is a lot of coverage stuff in between....
I have not really manually run the ceph-osd command, but wrapped it in:
#!/bin/bash

shopt -s -o pipefail

echo "$@" > /tmp/ceph-osd.$$.out

/usr/srcs/Ceph/work/ceph/build/bin/ceph-osd.bin "$@" | \
	tee -a /tmp/ceph-osd.$$.out

status=$?

echo ceph-osd done >> /tmp/ceph-osd.$$.out

exit $status
====

And this actually logs 'done' in the logfile. So the ceph-osd actually returns, and so does the wrapper.
As options is logs:

	--cluster=ceph --id=0 --osd-data=testdir/test-ceph-disk/dir

--osd-journal=testdir/test-ceph-disk/dir/journal

I could also log:
ENV
and rerun.

--WjW

#6 lore raw
In reply to Loic Dachary
Quoted 5 lines · Loic Dachary

Hi,

FYI when the init system is unknown, it runs ceph-osd directly instead of delegating to the init system.

https://github.com/ceph/ceph/blob/master/src/ceph-disk/ceph_disk/main.py#L3468

Yup, that I found out, so that is one of the reasons I fixed detect-init for FreeBSD and added bsdrc.
But at this point the test-script even calls it with --mark-init=none, so it should call it directly

Quoted 1 line

The reason why it does not daemonize is unclear to me.

That was an erroneous conclussion on my part. ceph-osd behaves as expected. But things get stuck somewhere in between.

"Fun" part is that scripts using ceph-disk do work and get osds created.... So it is mainly testing that now gets me busy.

--WjW

Quoted 100 lines

Cheers

Quoted 95 lines · Willem Jan Withagen

Hi,

As one of the last steps to complete my first run op porting I need to get ceph-disk working...
But I'm getting a stall in test_activate for the OSD. why doesn't the activation of the OSD background and the script continues.

--WjW

During testing is starts ceph-osd like:

function test_activate() {
    local to_prepare=$1
    local to_activate=$2
    local osd_uuid=$($uuidgen)

    ${CEPH_DISK} $CEPH_DISK_ARGS \
        prepare --osd-uuid $osd_uuid $to_prepare || return 1

    $timeout $TIMEOUT ${CEPH_DISK} $CEPH_DISK_ARGS \
        activate \
        --mark-init=none \
        $to_activate || return 1

    test_pool_read_write $osd_uuid || return 1
}

Which results in script output:

activate: ceph osd.0 data dir is ready at testdir/test-ceph-disk/dir
command_check_call: Running command_check: ../build/bin/ceph-osd --cluster=ceph --id=0 --osd-data=testdir/test-ceph-disk/dir --osd-journal=testdir/test-ceph-disk/dir/journal
starting osd.0 at - osd_data testdir/test-ceph-disk/dir testdir/test-ceph-disk/dir/journal

And is the processtable this looks like:

/usr/bin/timeout 360 /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage run --append --source=ceph_disk -- /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk --verbose --prepend-to-path= --statedir=testdir/test-ceph-disk --sysconfdir=testdir/test-ceph-disk activate --mark-init=none testdir/test-ceph-disk/dir

and:

CEPH_BIN=/usr/srcs/Ceph/work/ceph/build/bin
CEPH_ROOT=/usr/srcs/Ceph/work/ceph CEPH_CONF=/dev/null
LD_LIBRARY_PATH=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_BUILD_VIRTUALENV=/tmp
VIRTUAL_ENV=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27 PATH=/tmp/ceph-disk-virtualenv/bin:/tmp/ceph-detect-init-virtualenv/bin:.:../build/bin:/usr/srcs/Ceph/work/ceph/build/bin:.:/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin:/tmp/ceph-disk-virtualenv/bin:/home/wjw/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:.:/usr/srcs/Ceph/work/ceph/build/bin:/usr/srcs/Ceph/work/ceph/src PYTHONHASHSEED=648437795 CEPH_LIB=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_DISK=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage
run --append --source=ceph_disk --
/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk
PWD=/usr/srcs/Ceph/work/ceph/build CEPH_ARGS=
--fsid=19836d4d-ad32-429e-bf30-588f9d8d18d1 --auth-supported=none
--mon-host=127.0.0.1:7451 --chdir= --journal-dio=false
--erasure-code-dir=/usr/srcs/Ceph/work/ceph/build/lib
--plugin-dir=/usr/srcs/Ceph/work/ceph/build/lib
--log-file=testdir/test-ceph-disk/$name.log
--pid-file=testdir/test-ceph-disk/$name.pidfile
--osd-class-dir=/usr/srcs/Ceph/work/ceph/build/lib
--run-dir=testdir/test-ceph-disk --osd-failsafe-full-ratio=.99
--osd-journal-size=100 --debug-osd=20 --debug-bdev=20
--debug-bluestore=20 --osd-max-object-name-len=460
--osd-max-object-namespace-len=64 SHLVL=1 CEPH_MON=127.0.0.1:7451
_=/usr/bin/timeout ../build/bin/ceph-osd --cluster=ceph --id=0
--osd-data=testdir/test-ceph-disk/dir
--osd-journal=testdir/test-ceph-disk/dir/journal

And is the osd.0.log I see:

2016-11-11 13:41:36.562422 b678000  2 osd.0 0 boot
2016-11-11 13:41:36.614480 b678000  0 osd.0 0 done with init, starting
boot process
2016-11-11 13:41:36.614532 b678000  1 osd.0 0 We are healthy, booting
2016-11-11 13:41:36.614535 b678000 10 osd.0 0 start_boot - have maps 0..0
2016-11-11 13:41:36.616877 ba89b00 10 osd.0 0 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618842 b7d6d80 10 osd.0 5 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618846 b7d6d80 10 osd.0 5 _send_boot
2016-11-11 13:41:36.724501 b7d6d80 10 osd.0 6 boot_epoch is 6
2016-11-11 13:41:36.724505 b7d6d80  1 osd.0 6 state: booting -> active

So the OSD should actually finish and go into background. But the command stalls, and aborts after the shell timeout. --
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to Willem Jan Withagen
Quoted 6 lines · Willem Jan Withagen

Hi,

As one of the last steps to complete my first run op porting I need to get ceph-disk working...
But I'm getting a stall in test_activate for the OSD. why doesn't the activation of the OSD background and the script continues.

Right,

I was wrong.... After lots of prints and echos I have learned that ceph-osd does daemonize and return to the shell right after that with exit code 0 .
So there now everything is well.

Question is now back my favourite problem: figuring python out. :( Where between bin/ceph-osd and the command_check_call() things get hang up.

--WjW

Quoted 86 lines

During testing is starts ceph-osd like:

function test_activate() {
    local to_prepare=$1
    local to_activate=$2
    local osd_uuid=$($uuidgen)

    ${CEPH_DISK} $CEPH_DISK_ARGS \
        prepare --osd-uuid $osd_uuid $to_prepare || return 1

    $timeout $TIMEOUT ${CEPH_DISK} $CEPH_DISK_ARGS \
        activate \
        --mark-init=none \
        $to_activate || return 1

    test_pool_read_write $osd_uuid || return 1
}

Which results in script output:

activate: ceph osd.0 data dir is ready at testdir/test-ceph-disk/dir
command_check_call: Running command_check: ../build/bin/ceph-osd --cluster=ceph --id=0 --osd-data=testdir/test-ceph-disk/dir --osd-journal=testdir/test-ceph-disk/dir/journal
starting osd.0 at - osd_data testdir/test-ceph-disk/dir testdir/test-ceph-disk/dir/journal

And is the processtable this looks like:

/usr/bin/timeout 360 /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage run --append --source=ceph_disk -- /usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk --verbose --prepend-to-path= --statedir=testdir/test-ceph-disk --sysconfdir=testdir/test-ceph-disk activate --mark-init=none testdir/test-ceph-disk/dir

and:

CEPH_BIN=/usr/srcs/Ceph/work/ceph/build/bin
CEPH_ROOT=/usr/srcs/Ceph/work/ceph CEPH_CONF=/dev/null
LD_LIBRARY_PATH=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_BUILD_VIRTUALENV=/tmp
VIRTUAL_ENV=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27 PATH=/tmp/ceph-disk-virtualenv/bin:/tmp/ceph-detect-init-virtualenv/bin:.:../build/bin:/usr/srcs/Ceph/work/ceph/build/bin:.:/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin:/tmp/ceph-disk-virtualenv/bin:/home/wjw/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:.:/usr/srcs/Ceph/work/ceph/build/bin:/usr/srcs/Ceph/work/ceph/src PYTHONHASHSEED=648437795 CEPH_LIB=/usr/srcs/Ceph/work/ceph/build/lib
CEPH_DISK=/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/coverage
run --append --source=ceph_disk --
/usr/srcs/Ceph/work/ceph/src/ceph-disk/.tox/py27/bin/ceph-disk
PWD=/usr/srcs/Ceph/work/ceph/build CEPH_ARGS=
--fsid=19836d4d-ad32-429e-bf30-588f9d8d18d1 --auth-supported=none
--mon-host=127.0.0.1:7451 --chdir= --journal-dio=false
--erasure-code-dir=/usr/srcs/Ceph/work/ceph/build/lib
--plugin-dir=/usr/srcs/Ceph/work/ceph/build/lib
--log-file=testdir/test-ceph-disk/$name.log
--pid-file=testdir/test-ceph-disk/$name.pidfile
--osd-class-dir=/usr/srcs/Ceph/work/ceph/build/lib
--run-dir=testdir/test-ceph-disk --osd-failsafe-full-ratio=.99
--osd-journal-size=100 --debug-osd=20 --debug-bdev=20
--debug-bluestore=20 --osd-max-object-name-len=460
--osd-max-object-namespace-len=64 SHLVL=1 CEPH_MON=127.0.0.1:7451
_=/usr/bin/timeout ../build/bin/ceph-osd --cluster=ceph --id=0
--osd-data=testdir/test-ceph-disk/dir
--osd-journal=testdir/test-ceph-disk/dir/journal

And is the osd.0.log I see:

2016-11-11 13:41:36.562422 b678000  2 osd.0 0 boot
2016-11-11 13:41:36.614480 b678000  0 osd.0 0 done with init, starting
boot process
2016-11-11 13:41:36.614532 b678000  1 osd.0 0 We are healthy, booting
2016-11-11 13:41:36.614535 b678000 10 osd.0 0 start_boot - have maps 0..0
2016-11-11 13:41:36.616877 ba89b00 10 osd.0 0 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618842 b7d6d80 10 osd.0 5 _preboot _preboot mon has
osdmaps 1..5
2016-11-11 13:41:36.618846 b7d6d80 10 osd.0 5 _send_boot
2016-11-11 13:41:36.724501 b7d6d80 10 osd.0 6 boot_epoch is 6
2016-11-11 13:41:36.724505 b7d6d80  1 osd.0 6 state: booting -> active

So the OSD should actually finish and go into background. But the command stalls, and aborts after the shell timeout. --
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
Quoted 10 lines · Willem Jan Withagen
Quoted 6 lines · Willem Jan Withagen

Hi,

As one of the last steps to complete my first run op porting I need to get ceph-disk working...
But I'm getting a stall in test_activate for the OSD. why doesn't the activation of the OSD background and the script continues.

Right,

Quoted 7 lines

I was wrong.... After lots of prints and echos I have learned that ceph-osd does daemonize and return to the shell right after that with exit code 0 .
So there now everything is well.

Question is now back my favourite problem: figuring python out. :( Where between bin/ceph-osd and the command_check_call() things get hang up.

Well, the plot thinkens.... and it gets weirder and weirder.

Both ceph-osd, ceph-disk and coverage return. Just filled the python up with prints till I was sure....

Removing the timeout 360 from the commandline in test.sh actually gets the job done. So one way or another /usr/bin/timeout thinks that the process did not finish. And that is something I have not seen before.

Looking at the pstree ceph-osd is a direct child of timeout. No more processes in between. So all intermediate work seems te be done. And I'm not sure why timeout thinks its children are not finished. Note that this is the only case where timeout starts acting up.

I guess that I'm going to if-fi it for the time being...

--WjW