ceph-ansible icon indicating copy to clipboard operation
ceph-ansible copied to clipboard

improving manageability of systemd target units

Open scheuref opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe.

  • systemctl start ceph-osd.target is not working instead, the less intuitive systemctl start --all ceph-osd"@*.service" is needed
  • systemctl disable --now ceph-osd.target is not preventing all unit instances to start during reboot instead, one must mask all unit instances before reboot and unmask after, or one can mask the template unit using /etc/systemd/system.control/ as explained in cf. https://github.com/systemd/systemd/issues/12084#issuecomment-802468029

Describe the solution you'd like both issues can be solved easily by making the [email protected] unit a "child" of the ceph-osd.target unit instead of ceph.target:

for i in /etc/systemd/system/ceph-*.target; do
    sed -i "${i/.target/@.service}" -e "s/^WantedBy=ceph\.target\$/WantedBy=${i##*/}/"
done 
systemctl reenable $(systemctl list-units -t service --all --no-pager --full --plain --no-legend "ceph-*"| awk '/ceph-/ {print $1}')
systemctl daemon-reload

following is then working:

  • systemctl stop ceph-osd.target then systemctl start ceph-osd.target
  • systemctl disable --now ceph-osd.target then (e.g. after reboot) systemctl enable --now ceph-osd.target

following is working (as before the change):

  • systemctl stop ceph.target then systemctl start ceph.target

following is still not preventing all unit instances to start during reboot (as before the change):

  • systemctl disable --now ceph.target

Describe alternatives you've considered see problem description

Additional context following ansible files could be changed accordingly: ./roles/ceph-mds/templates/ceph-mds.service.j2 ./roles/ceph-mgr/templates/ceph-mgr.service.j2 ./roles/ceph-mon/templates/ceph-mon.service.j2 ./roles/ceph-osd/templates/ceph-osd.service.j2 ./roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 ./roles/ceph-rgw/templates/ceph-radosgw.service.j2

scheuref avatar Jul 15 '22 11:07 scheuref

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 30 '22 20:07 github-actions[bot]

removing 'wontfix' label as this is a valid RFE that could be easily addressed, i think.

guits avatar Aug 03 '22 12:08 guits

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 18 '22 20:08 github-actions[bot]

This issue has been automatically closed due to inactivity. Please re-open if this still requires investigation.

github-actions[bot] avatar Aug 25 '22 20:08 github-actions[bot]