[systemd-bugs] [Bug 75104] New: Drop-in files to override units files does not work

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Feb 17 08:25:14 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=75104

          Priority: medium
            Bug ID: 75104
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: Drop-in files to override units files does not work
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: rfnx.poubelle at gmail.com
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

Hello,

In order to manage dependency between systemd units, I wanted to use drop-in
files to override settings in unit files, but some options are not parsed. 

The manpage says : "Along with a unit file foo.service, a directory
foo.service.d/ may exist. All files with the suffix ".conf" from this directory
will be parsed after the file itself is parsed. This is useful to alter or add
configuration settings to a unit, without having to modify their unit files.
Make sure that the file that is included has the appropriate section headers
before any directive."

It works for options like "Require" or "After" (Unit section), but not for
"RequiredBy" or "WantedBy" (Install section). Maybe it doesn't work with other
options but I couldn't try them all. So at the moment I have to stay with the
old and not recommended method, as the manpage says : create a unit file with
the same name in /etc/systemd/system to override the one in
/usr/lib/systemd/system. This way, it works perfectly.




Step to reproduce (on Archlinux) :

- Create a directory in /etc/systemd/system with the name "unit.d" (replace
unit with the name of an installed unit, for example postgresql.service)

-create a .conf file which contain a RequiredBy option with the name of an
other installed unit)

-do "systemctl daemon-reload" to reload unit files

-do "systemctl status unit" (replace unit with the name of the modified unit,
for example postgresql.service) or "systemd-delta" to verify your .conf file
has been parsed

-do "systemctl show -p "RequiredBy" unit" (replace unit with the name of the
modified unit) to verify if the RequiredBy option has been parsed

Result : RequiredBy isn't modified by the .conf file

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20140217/3ab5b1b0/attachment.html>


More information about the systemd-bugs mailing list