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

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

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github 3016 0 None None None 2017-03-23 07:05:13 UTC
Red Hat Product Errata RHBA-2017:2297 0 normal SHIPPED_LIVE systemd bug fix and enhancement update 2017-08-01 12:40:16 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):

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

Steps to Reproduce:

echo "
Description=Demo service

ExecStart=/usr/bin/ls /tmp/ > /dev/null

" > /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

Comment 4 Lukáš Nykrýn 2017-04-10 14:59:27 UTC
fix merged to upstream staging branch ->
-> 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.


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