From: Dan van der Ster Date: Mon, 30 Jul 2018 12:53:07 +0000 (+0200) Subject: ceph-volume: optional systemd enable --runtime X-Git-Tag: v13.2.2~116^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=be4ef8648611f4fb7a18c881fcba9677bede85ac;p=ceph.git ceph-volume: optional systemd enable --runtime Allow units to be enabled but not persisted across a reboot, and use this when enabling osds. Signed-off-by: Dan van der Ster (cherry picked from commit 3e6f387be13b209aa9f56f5069331e449615d316) --- diff --git a/src/ceph-volume/ceph_volume/systemd/systemctl.py b/src/ceph-volume/ceph_volume/systemd/systemctl.py index 688433774f15..41dbbc19e644 100644 --- a/src/ceph-volume/ceph_volume/systemd/systemctl.py +++ b/src/ceph-volume/ceph_volume/systemd/systemctl.py @@ -12,8 +12,11 @@ def stop(unit): process.run(['systemctl', 'stop', unit]) -def enable(unit): - process.run(['systemctl', 'enable', unit]) +def enable(unit, runtime=False): + if runtime: + process.run(['systemctl', 'enable', '--runtime', unit]) + else: + process.run(['systemctl', 'enable', unit]) def disable(unit): @@ -41,7 +44,7 @@ def stop_osd(id_): def enable_osd(id_): - return enable(osd_unit % id_) + return enable(osd_unit % id_, runtime=True) def disable_osd(id_):