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>
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):
def enable_osd(id_):
- return enable(osd_unit % id_)
+ return enable(osd_unit % id_, runtime=True)
def disable_osd(id_):