improving manageability of systemd target units
Is your feature request related to a problem? Please describe.
-
systemctl start ceph-osd.targetis not working instead, the less intuitivesystemctl start --all ceph-osd"@*.service"is needed -
systemctl disable --now ceph-osd.targetis 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.targetthensystemctl start ceph-osd.target -
systemctl disable --now ceph-osd.targetthen (e.g. after reboot)systemctl enable --now ceph-osd.target
following is working (as before the change):
-
systemctl stop ceph.targetthensystemctl 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
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.
removing 'wontfix' label as this is a valid RFE that could be easily addressed, i think.
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.
This issue has been automatically closed due to inactivity. Please re-open if this still requires investigation.