Sample Header Ad - 728x90

Managing systemd services on read-only filesystem

1 vote
1 answer
4163 views
I am looking for strategies how to manage enabling and disabling of systemd services on a read-only filesystem. It's not possible as the multi-user.target.wants directory contents get modified. Keeping /etc/systemd/system as the default location for services, has anyone tried ways to manage the launch 'table' / multi-user.target.wants directory such that an application or script running on the target can still enable or disable a specific service (or services) even though the filesystem is RO? I have thought to symlink the multi-user.target.wants directory to a location on a small rw "config" partition and switch between pre-set multi-user.target.wants directories on boot/reboot according to the need. Alternatively, I suppose a script or application could directly modify this symlinked location by adding or removing entries from it. I have not tested that yet; I wanted to see if anyone has experience with this, possible strategies, or know of a more standardized approach to this? Thank you.
Asked by chameleon (31 rep)
Jul 21, 2022, 04:05 PM
Last activity: Apr 17, 2025, 10:08 AM