I'm working on setting up a Linux server that will have dozens of daemons controlled by systemd. The daemons are grouped into targets so that they can be brought up and down in groups, but the system administrators can manually control individual services. I am looking for a way to preserve the state (which services are activated) through a reboot. The idea is that people debugging, testing, and developing on the server can reboot it if needed and have the system come up in the same configuration as it was before the reboot.
snapshot functionality seems ideal for this, but as far as I can tell you can't write a snapshot to disk for use later.
My initial plan was to create a symlink from
multi-user.target.wants/ to a service called
bootingup.service. Every target the system administrator activates would then rewrite
bootingup.service.d/bootingup.conf to launch the target that was just activated. This would mean that on boot the system would activate the most recently launched target, but it wouldn't remember any services that were individually activated/deactivated.
Is there a way to make systemd remember the state of all services across a reboot?