]> 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)
committerAlfredo Deza <adeza@redhat.com>
Thu, 2 Aug 2018 14:05:48 +0000 (10:05 -0400)
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>
(cherry picked from commit 3e6f387be13b209aa9f56f5069331e449615d316)

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_):