[systemd-devel] systemd-service for each user

Mantas Mikulėnas grawity at gmail.com
Tue Nov 11 11:35:25 PST 2014


On Tue, Nov 11, 2014 at 7:52 PM, Jakob Schürz <wertstoffe at nurfuerspam.de> wrote:
> Hi!
>
> I don't know, for which words I have to search to find a solution for my
> Problem.
>
> On my server i created a mailserver.target, on which all relevant services
> for the mailserver depend. So i can [re]start and stop all services (exim4,
> cyrus, saslauthd, amavis...) only with
>
> systemctl start|restart|stop mailserver.target

> But i don't know, how to start this unit for each user.
> systemctl start mailserver should scan each user and start
> fetchmail at user1.service, fetchmail at user2.service...
>
> Is this possible with systemd? Or should i create a shell-script to do the
> job?

I'm not sure I understand the point of having fetchmail download *from
localhost*... it looks like it should be completely independent from
cyrus/etc.

Anyway, there is no command to "scan each user". To start multiple
units at once, make the target want all of them individually:
mailserver.target.wants/fetchmail at user1.service, and so on.

-- 
Mantas Mikulėnas <grawity at gmail.com>


More information about the systemd-devel mailing list