You are not logged in.

#1 2014-07-31 13:23:05

Ch33f
Member
Registered: 2014-07-31
Posts: 6

Enabling services via systemd only for certain targets

Hi everyone,

I have been searching and searching and I struggled through manpages but found nothing...

How can you enable services using systemd for a certain target?
Something like "systemd enable --target.graphical gdm".

My idea is to have 2 grub entries, one that boots into target.multi-user and the other that boots into target.graphical.
Then I would enable the gdm and other services I want for target.graphical but not for target.multi-user. That way I could choose on bootup if I want gnome this time or not and have a custom fallback/high performance mode.


I hope I'm not just utterly blind and wasting erverybodys time but I didn't find any information on this whatsoever.
Thanks in advance guys!

Last edited by Ch33f (2014-07-31 13:23:55)

Offline

#2 2014-07-31 13:26:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Enabling services via systemd only for certain targets

Wouldn't adding 'systemd.unit=graphical.target' to the kernel command line work?

Offline

#3 2014-07-31 13:27:28

Ch33f
Member
Registered: 2014-07-31
Posts: 6

Re: Enabling services via systemd only for certain targets

Yeah thats the part for adding the grub entries. I think I got that one but how do I tell systemd that I want service A on target.X but not service B and service B on target.Y but not service C?

Last edited by Ch33f (2014-07-31 13:27:52)

Offline

#4 2014-07-31 13:39:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Enabling services via systemd only for certain targets

Offline

#5 2014-07-31 13:41:05

Ch33f
Member
Registered: 2014-07-31
Posts: 6

Re: Enabling services via systemd only for certain targets

Oh god this one almost hidden sentence:

If you make use of those it is suggested that you make a new named systemd target as /etc/systemd/system/your target that takes one of the existing runlevels as a base (you can look at /usr/lib/systemd/system/graphical.target as an example), make a directory /etc/systemd/system/your target.wants, and then symlink the additional services from /usr/lib/systemd/system/ that you wish to enable.

Ok thats a start.
But there is no parameter in "systemd enable" that I could use to do it?

Last edited by Ch33f (2014-07-31 13:43:49)

Offline

#6 2014-07-31 13:43:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Enabling services via systemd only for certain targets

There's a part about creating custom targets.

Offline

#7 2014-07-31 13:44:16

Ch33f
Member
Registered: 2014-07-31
Posts: 6

Re: Enabling services via systemd only for certain targets

Sorry didn't edit fast enough.

Offline

Board footer

Powered by FluxBB