]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: optional systemd enable --runtime
authorDan van der Ster <daniel.vanderster@cern.ch>
Mon, 30 Jul 2018 12:53:07 +0000 (14:53 +0200)
committerDan van der Ster <daniel.vanderster@cern.ch>
Mon, 30 Jul 2018 12:57:03 +0000 (14:57 +0200)
Allow units to be enabled but not persisted across a reboot,
and use this when enabling osds.

Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
src/ceph-volume/ceph_volume/systemd/systemctl.py

index 688433774f15056e6f7b824e802450d06137a5cb..41dbbc19e644d42e059d850c203543e5d89ec8ab 100644 (file)
@@ -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_):