Great, thanks! Lennart Poettering <[email protected]> schrieb am Sa., 29. Apr. 2017, 19:32:
> On Wed, 26.04.17 11:08, Benno Fünfstück ([email protected]) > wrote: > > > > I have the problem that I want to run a set of services that are > isolated > > > from the other services. In particular, I'd like to: > > > > > > * share some environment variables between these services, that aren't > > > available for services outside the group > > > * be able to stop all the services in the group and wait for proper > > > shutdown > > > * (would be nice) load services for the group from a different > directory > > > than the default one > > > * (would be nice) be able to add transient services to the group with > > > systemd-run > > > > > > Is such a thing possible with systemd? If not, is it feasible to > implement > > > something like this (even if it doesn't match exactly what I want)? > > > > > > Regards, > > > Benno > > > > > > > Just to add if that wasn't clear: I'd like to run this group for multiple > > different sets of environment variables, and be able to "start" the group > > for some assignment of environment variables (these variables will not > > change during the lifetime of the group though) > > If you want multiple instantation you can use systemd's instance > logic. i.e. you could have: > > [email protected] > > This target unit could then have Wants= deps on your various services, > always passing along the instance identifier: > > [Unit] > Wants=myservice1@%i.service myservice2@%i.service > > Then, insce the service units you'd add a PartsOf= dep back: > > [Unit] > PartOf=mygroup@%i.target > > And then pull in the environment file based on the instance: > > [Service] > EnvironmentFile=/path/to/my/env-file-%i.conf > > I hope that makes sense, > > Lennart > > -- > Lennart Poettering, Red Hat >
_______________________________________________ systemd-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/systemd-devel
