Bug 1435098 - Systemd bogus "No [Install] section" warning
Summary: Systemd bogus "No [Install] section" warning
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-23 07:05 UTC by Yogita
Modified: 2017-08-01 09:14 UTC (History)
4 users (show)

Fixed In Version: systemd-219-33.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 09:14:52 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2297 normal SHIPPED_LIVE systemd bug fix and enhancement update 2017-08-01 12:40:16 UTC
Github 3016 None None None 2017-03-23 07:05:13 UTC

Description Yogita 2017-03-23 07:05:13 UTC
Description of problem:
Systemd bogus "No [Install] section" warning when enabling a unit with full path, like "systemctl enable /some/path/myunit.service"

Version-Release number of selected component (if applicable):
systemd-219-30.el7.x86_64

How reproducible:
By making a customised service file at location other than /etc/systemd/system and /usr/lib/systemd/system

Steps to Reproduce:

echo "
[Unit]
Description=Demo service

[Service]
User=root
ExecStart=/usr/bin/ls /tmp/ > /dev/null

[Install]
WantedBy=multi-user.target
" > /demo.service

Actual results:

systemctl enable /demo.service
Created symlink from /etc/systemd/system/multi-user.target.wants/demo.service to /demo.service.
Created symlink from /etc/systemd/system/demo.service to /demo.service.
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).


Expected results:
systemctl enable /demo.service
Created symlink from /etc/systemd/system/multi-user.target.wants/demo.service to /demo.service.
Created symlink from /etc/systemd/system/demo.service to /demo.service.

Additional info:
The misleading error is "The unit files have no [Install] section." 
The service unit is having [Install] section , still its reporting false error.

After enabling the service , we can execute - systemctl start demo.service flawlessly

see https://github.com/systemd/systemd/pull/3016 
A fix has been applied in systemd-230 and later, this is available in fedora25. When can we expect this fix in redhat?

Comment 2 Jan Synacek 2017-03-23 09:42:06 UTC
https://github.com/lnykryn/systemd-rhel/pull/101

Comment 4 Lukáš Nykrýn 2017-04-10 14:59:27 UTC
fix merged to upstream staging branch ->
https://github.com/lnykryn/systemd-rhel/commit/b5eddaf0dea35bda7b68a401119c5f9f9104fb99
-> post

Comment 7 errata-xmlrpc 2017-08-01 09:14:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2297


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