Bug 1141824 - Environment= from admin's settings is beaten by the /usr/lib drop-in with .include
Summary: Environment= from admin's settings is beaten by the /usr/lib drop-in with .i...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 20
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: 2014-09-15 14:26 UTC by Pavel Raiskup
Modified: 2014-09-17 11:47 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-17 09:59:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Reproducer (80.03 KB, application/octet-stream)
2014-09-15 14:26 UTC, Pavel Raiskup
no flags Details

Description Pavel Raiskup 2014-09-15 14:26:54 UTC
Created attachment 937632 [details]
Reproducer

Better to show via attached reproducer:

$ tar xf simple_sample* && cd simple_sample
$ ./configure --prefix=/usr
$ # check that I'm not kidding you..
$ make install DESTDIR=`pwd`/installdir && find installdir
...
installdir/etc/systemd/system/a.service
...
installdir/usr/lib/systemd/system/a.service.d
installdir/usr/lib/systemd/system/a.service.d/50-default.conf
...
$ sudo make install

$ # this fails intentionally
$ sudo systemctl start a.service
$ sudo systemctl status a.service
....
Sep 15 16:19:45 redhat.com systemd-dump-env[16710]: RESULT=system-dropin
....                                             NOTE THIS ^^^^

IMHO, you should see 'user-service' string there, as specified by installed
/etc/systemd/system/a.service.  This gives to user unexpected behavior when
some system-default drop-in is installed and .include is used.

Comment 1 Michal Sekletar 2014-09-16 08:44:03 UTC
Drop-ins are applied "out-of-band". They are applied on top of configuration parsed from unit files, hence may reset/override those value. However usual configuration hierarchy semantics applies to them as well.

Also note that use of .include is discouraged. Users should use drop-ins in /etc to permanently reset/override vendor supplied configuration.

Comment 2 Pavel Raiskup 2014-09-16 09:58:33 UTC
(In reply to Michal Sekletar from comment #1)
> Drop-ins are applied "out-of-band". They are applied on top of configuration
> parsed from unit files, hence may reset/override those value. However usual
> configuration hierarchy semantics applies to them as well.

Truth, that is what is this bug about.  I would expect that parser starts at
/etc/lib/*/*.service, which invokes the .include ~> so
'/usr/lib/*/*.service is parsed, then '/usr/lib/*/*.service.d', then
remaining part of '/etc/*/*.service and then '/etc/*/*.service.d/ dropins.

> Also note that use of .include is discouraged. Users should use drop-ins in
> /etc to permanently reset/override vendor supplied configuration.

Yup, I plan on stopping the advices to use .include (in our service files
documentation) and migrate to drop-in.  The problem is that I would like to
stay compatible (lets say that I - as a packager -  wan't keep the
InterfaceStabilityPromise) with existing service files under /etc admins
already have.  This (bug?), however, blocks me and I can't install drop-ins
under /usr/lib.

Comment 3 Pavel Raiskup 2014-09-16 11:24:02 UTC
Asked privately to do upstream report, thanks for looking at this issue,
http://lists.freedesktop.org/archives/systemd-devel/2014-September/023089.html


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