]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/ceph-volume/ceph_volume/systemd/systemctl.py
update sources to 12.2.2
[ceph.git] / ceph / src / ceph-volume / ceph_volume / systemd / systemctl.py
index 9bb4d7d3a0e30b30c899e5c9228e653bc29cb3d3..ab8f3e70ae31d8650b7f5661cebda0a41ad77a55 100644 (file)
@@ -20,6 +20,10 @@ def disable(unit):
     process.run(['sudo', 'systemctl', 'disable', unit])
 
 
+def mask(unit):
+    process.run(['sudo', 'systemctl', 'mask', unit])
+
+
 def start_osd(id_):
     return start(osd_unit % id_)
 
@@ -40,9 +44,20 @@ def enable_volume(id_, fsid, device_type='lvm'):
     return enable(volume_unit % (device_type, id_, fsid))
 
 
+def mask_ceph_disk():
+    # systemctl allows using a glob like '*' for masking, but there was a bug
+    # in that it wouldn't allow this for service templates. This means that
+    # masking ceph-disk@* will not work, so we must link the service directly.
+    # /etc/systemd takes precendence regardless of the location of the unit
+    process.run(
+        ['sudo', 'ln', '-sf', '/dev/null',  '/etc/systemd/system/ceph-disk@.service']
+    )
+
+
 #
 # templates
 #
 
 osd_unit = "ceph-osd@%s"
+ceph_disk_unit = "ceph-disk@%s"
 volume_unit = "ceph-volume@%s-%s-%s"