Bug 758047 - RFE: allow local customization of units
Summary: RFE: allow local customization of units
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-29 09:23 UTC by Enrico Scholz
Modified: 2011-12-02 09:34 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-02 09:34:17 UTC
Type: ---


Attachments (Terms of Use)

Description Enrico Scholz 2011-11-29 09:23:52 UTC
Description of problem:

It would be nice when units could be customized locally. E.g. the stop timeout of proxy servers (tor, squid) depends on the use case and should be customizable by the administrator.

First tries like

| [Service]
| Environment = TOR_SHUTDOWN_WAIT=30
| Environment = TOR_NOFILE=4096
| EnvironmentFile = -/etc/sysconfig/tor
| TimeoutSec = ${TOR_SHUTDOWN_WAIT}
| LimitNOFILE = ${TOR_NOFILE}

do not work because environment variables are expanded for special stanzas only.

A solution might be service files ending with .append (e.g. '/etc/systemd/systemd/tor.service.append') which are (logically) appended to existing units and can override default settings.

This would make it also possible, to define behavior of foo@ units depending on the instance.

Comment 1 Michal Schmidt 2011-11-29 11:42:45 UTC
You can override packaged units by adding unit files in /etc/systemd/system. There you can use ".include" and override only the settings you want. See
http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
This mechanism should be sufficient for your use-case. Is it not?


There is an entry on the systemd TODO list to add another mechanism:
* read config fragments for all units from /lib/systemd/system/foobar.service.d/ to override/extend specific settings

Comment 2 Enrico Scholz 2011-12-02 09:34:17 UTC
thx; will work in the described way


Note You need to log in before you can comment on or make changes to this bug.