[lug] Systemd unit file experiments

Rob Nagler nagler at bivio.biz
Sat Mar 31 13:20:03 MDT 2018


On Sat, Mar 31, 2018 at 12:04 PM, Zan Lynx wrote:

> You can parameterize unit files. Look into how to use the @ symbol
> combined with symbolic links.
>

You can parameterize with a single parameter (%i). You can't override any
values by, for example, defining them in foo at bar.service or
foo at bar.service.d. This restricts polymorphism to simple macro replacement,
which is sufficient for things like timers but not more complex services.

For our httpd invocations on CentOS 6, we source /etc/init.d/httpd and then
change some  variables either by defining them before or after. This allows
us to reuse the distro's /etc/init.d/httpd. You can't get that kind of
reuse with /usr/lib/systemd/system/httpd.service. You can copy-and-paste.

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20180331/1cda0aeb/attachment.html>


More information about the LUG mailing list