|
|
Subscribe / Log in / New account

Control Centre: The systemd Linux init system (The H)

Control Centre: The systemd Linux init system (The H)

Posted May 8, 2012 22:09 UTC (Tue) by johannbg (guest, #65743)
In reply to: Control Centre: The systemd Linux init system (The H) by geuder
Parent article: Control Centre: The systemd Linux init system (The H)

You can create a new unit that has the same name in /etc/systemd/system directory which contains only .include reference and your custom change.

That will ensure that your custom unit will inherit all "updates" security or otherwise made by the distribution relevant package maintainer to the relevant unit to his package while giving you the flexibility to have your own modifications.

For example let's say you want systemd to automatically restart the apache service should the apache daemon exits with an exit code not equaling 0,when it is terminated by a signal,when an operation times out or when the configured watchdog timeout is triggered.

You would create a new unit in the /etc/systemd/system directory called httpd.service and it would contain...

.include /usr/lib/systemd/system/httpd.service

[Service]
Restart=on-failure

That's it...


to post comments

Control Centre: The systemd Linux init system (The H)

Posted May 8, 2012 22:34 UTC (Tue) by geuder (subscriber, #62854) [Link] (1 responses)

OK, this should work as long as your changes can be expressed by just adding new lines in the beginning and/or end of the stock configuration.

(No I haven't real production experience with systemd yet. Just played a bit with F16, but there were no tricky requrements for playing)

Control Centre: The systemd Linux init system (The H)

Posted May 9, 2012 18:14 UTC (Wed) by zlynx (guest, #2285) [Link]

I have not checked, but it is possible that the configuration merges sections with the same names.

That would mean you could override lines in the middle of the configuration too.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds