From 3e6f387be13b209aa9f56f5069331e449615d316 Mon Sep 17 00:00:00 2001 From: Dan van der Ster Date: Mon, 30 Jul 2018 14:53:07 +0200 Subject: [PATCH] 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 --- src/ceph-volume/ceph_volume/systemd/systemctl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ceph-volume/ceph_volume/systemd/systemctl.py b/src/ceph-volume/ceph_volume/systemd/systemctl.py index 688433774f150..41dbbc19e644d 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_): -- 2.39.5