From: Loic Dachary Date: Tue, 12 Jul 2016 14:56:52 +0000 (+0200) Subject: ceph-disk: timeout ceph-disk to avoid blocking forever X-Git-Tag: ses5-milestone5~205^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10262%2Fhead;p=ceph.git ceph-disk: timeout ceph-disk to avoid blocking forever When ceph-disk runs from udev or init script, it is in the background and should it block for any reason, it may keep a lock forever. All calls to ceph-disk in these context are changed to timeout. The TimeoutStartSec= and TimeoutStopSec= which are both set via TimeoutSec= do not apply to Type=oneshot services. https://www.freedesktop.org/software/systemd/man/systemd.service.html Fixes: http://tracker.ceph.com/issues/16580 Signed-off-by: Loic Dachary --- diff --git a/systemd/ceph-disk@.service b/systemd/ceph-disk@.service index 8b18ba4349d..f13c30beb10 100644 --- a/systemd/ceph-disk@.service +++ b/systemd/ceph-disk@.service @@ -4,5 +4,5 @@ Description=Ceph disk activation: %f [Service] Type=oneshot KillMode=none -ExecStart=/bin/sh -c 'flock /var/lock/ceph-disk /usr/sbin/ceph-disk --verbose --log-stdout trigger --sync %f' +ExecStart=/bin/sh -c 'timeout 120 flock /var/lock/ceph-disk /usr/sbin/ceph-disk --verbose --log-stdout trigger --sync %f' TimeoutSec=0