Systemd tip: service conditionals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In relation to the 'when startup delays become bugs' thread, it occurs
to me that perhaps not all packagers / devs know about one of the neater
systemd capabilities: conditional service activation. You can make
activation of your service conditional on a wide range of things,
including:

1. The existence of a path or file
2. The fact that a file or directory actually contains something
3. The fact that a file is executable
4. The presence of a given parameter (or value of a parameter) on the
kernel cmdline
5. Whether the system is a VM (and what virtualization software it's
using)
6. Whether the system is on AC power
7. Whether or not SELinux is enabled
8. Whether a given capability exists

It's really neat stuff, and very easy to use: you just add a
Condition(Something) statement to the .service file. For details on
using these conditions, see 'man systemd.unit' and just search for
Condition, and you'll find a list of all the available Conditions and
how to use them.
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | identi.ca: adamwfedora
http://www.happyassassin.net

-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux