X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Fsystemd%2Fsystemctl.py;fp=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Fsystemd%2Fsystemctl.py;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=d5fd0dd8083ef14df1ae40c505a4a72dc7448fb5;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/ceph-volume/ceph_volume/systemd/systemctl.py b/src/ceph/src/ceph-volume/ceph_volume/systemd/systemctl.py deleted file mode 100644 index d5fd0dd..0000000 --- a/src/ceph/src/ceph-volume/ceph_volume/systemd/systemctl.py +++ /dev/null @@ -1,63 +0,0 @@ -""" -Utilities to control systemd units -""" -from ceph_volume import process - - -def start(unit): - process.run(['systemctl', 'start', unit]) - - -def stop(unit): - process.run(['systemctl', 'stop', unit]) - - -def enable(unit): - process.run(['systemctl', 'enable', unit]) - - -def disable(unit): - process.run(['systemctl', 'disable', unit]) - - -def mask(unit): - process.run(['systemctl', 'mask', unit]) - - -def start_osd(id_): - return start(osd_unit % id_) - - -def stop_osd(id_): - return stop(osd_unit % id_) - - -def enable_osd(id_): - return enable(osd_unit % id_) - - -def disable_osd(id_): - return disable(osd_unit % id_) - - -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( - ['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"