]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: systemd unit must run after local-fs.target
authorLoic Dachary <ldachary@redhat.com>
Tue, 22 Nov 2016 13:45:45 +0000 (14:45 +0100)
committerLoic Dachary <ldachary@redhat.com>
Mon, 5 Dec 2016 08:51:05 +0000 (09:51 +0100)
A ceph udev action may be triggered before the local file systems are
mounted because there is no ordering in udev. The ceph udev action
delegates asynchronously to systemd via ceph-disk@.service which will
fail if (for instance) the LVM partition required to mount /var/lib/ceph
is not available yet. The systemd unit will retry a few times but will
eventually fail permanently. The sysadmin can systemctl reset-fail at a
later time and it will succeed.

Add a dependency to ceph-disk@.service so that it waits until the local
file systems are mounted:

After=local-fs.target

Since local-fs.target depends on lvm, it will wait until the lvm
partition (as well as any dm devices) is ready and mounted before
attempting to activate the OSD. It may still fail because the
corresponding journal/data partition is not ready yet (which is
expected) but it will no longer fail because the lvm/filesystems/dm are
not ready.

Fixes: http://tracker.ceph.com/issues/17889
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit d954de5546ea34a07c1e4234b07c1cef6ab74463)

systemd/ceph-disk@.service

index f13c30beb103d02afaffbb7e99e4b506b831a809..5d1d557dc48cdc1899a5df5cc67bd720dca967be 100644 (file)
@@ -1,5 +1,7 @@
 [Unit]
 Description=Ceph disk activation: %f
+After=local-fs.target
+Wants=local-fs.target
 
 [Service]
 Type=oneshot