[systemd-devel] How to use "systemctl preset" ?

Andrey Borzenkov arvidjaar at gmail.com
Sun Dec 8 09:13:44 PST 2013


В Mon, 9 Dec 2013 01:58:38 +0900
Tony Seo <tonyseo7 at gmail.com> пишет:

> Hello.
> 
> I have tried to use "systemctl preset" command.
> 
> As you know that systemd.org already explained preset in manual page, So I
> read those things about preset and some example to use "systemctl preset".
> 
> http://www.freedesktop.org/software/systemd/man/systemd.preset.html
> 
> But, when I try "systemctl preset" command, systemd print error like below.
> 
> $systemctl preset
> Too few arguments.(error msg)
> 

It requires at least one unit name ...

> $ls
> 00-first.preset
> $systemctl preset 00-first.preset
> Failed to issue method call: Invalid argument(error msg)
> 

... which must be unit name, not arbitrary file.

> I think I have been experiencing him who already sent a mail related with
> me.
> https://bugs.freedesktop.org/show_bug.cgi?id=64215
> 
> 
> But I couldn't understand what Lennart said like below.
> 
> * If you specify just "test" as parameter, then this would cause
> "test.service" to be reset to the preset default, but since
> "test.service" doesn't exist on your machine this fails.*
> 
> 
> i hope someone who shall explain how to apply "systemctl preset" to
> enable/disable many units at once.
> 

You need to list all units as arguments to "systemctl preset". As I
understand, that's intended more for packaging support where package
can issue "systemctl preset unit" during installation to enable/disable
unit according to local policy. So it is more "remove policy knowledge
from command" than "automate many units at once".


More information about the systemd-devel mailing list