]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-disk: run the right executables from udev
authorJosh Durgin <josh.durgin@inktank.com>
Wed, 29 Jan 2014 01:26:58 +0000 (17:26 -0800)
committerAlfredo Deza <alfredo@deza.pe>
Wed, 12 Feb 2014 21:17:12 +0000 (16:17 -0500)
commit5ebd7c4520a9805f985cab1a0ba9311e19efa041
treec81323668ddc715d93c0240ab67da2f141f6aa82
parent4a7c4e0a81753dfb811396e7bfa1df72135ee12b
ceph-disk: run the right executables from udev

When run by the udev rules, PATH is not defined. Thus,
ceph-disk-activate relies on its which() function to locate the
correct executable.  The which() function used os.defpath if none was
set, and this worked for anything using it.

ad6b4b4b08b6ef7ae8086f2be3a9ef521adaa88c added a new default value to
PATH, so only /usr/bin was checked by callers that did not use
which(). This resulted in the mount command not being found when
ceph-disk-activate was run by udev, and thus osds failing to start
after being prepared by ceph-deploy.

Make ceph-disk consistently use the existing helpers (command() and
command_check_call()) that use which(), so lack of PATH does not
matter. Simplify _check_output() to use command(),
another wrapper around subprocess.Popen.

Fixes: #7258
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit d7b0c7faafd37e4ae8a1680edfa60c22b419cbd8)
src/ceph-disk