[systemd-devel] Stateless System Presets

Silvio Knizek killermoehre at gmx.net
Fri Aug 2 08:20:31 UTC 2019


Am Donnerstag, den 01.08.2019, 16:48 +0000 schrieb Quinn Mikelson:
> I work at a company who develops a number of semi-stateless systems.
> My current challenge is integrating out growing number of vendor-
> specific applications and services into a system with persistent /etc
> and /usr directories.
>
> These images are generated using Buildroot with initramfs
> filesystems; I'm using the term semi-stateless, because their /etc
> and /usr directories can be "patched" during runtime, but are
> otherwise refreshed upon each reboot.
>
> The specific services that get enabled on boot change from image to
> image, so I'd ideally like a single file to describe each image for
> ease of management.
>
> The system-preset mechanism seems like it was designed for this
> application, unfortunately it seems geared toward volatile systems,
> and only operates from within the running system after executing
> something like systemctl preset-all.
>
> Is there an accepted method of maintaining and applying a preset
> service during image packaging or upon system boot for stateless
> systems? My current solution is manually parsing the preset files
> with a custom script and creating or deleting symlinks accordingly.
>
> -Quinn

Hi,

you could try the kernel command line[1] option systemd.wants= to set
up your target state. The option can be used several times or you
define the proper .target for the different system images.

BR
Silvio

[1] man:kernel-command-line



More information about the systemd-devel mailing list