Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1435098

Summary: Systemd bogus "No [Install] section" warning
Product: Red Hat Enterprise Linux 7 Reporter: Yogita <ysoni>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Frantisek Sumsal <fsumsal>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.3CC: bblaskov, fsumsal, jsynacek, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: systemd-219-33.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 09:14:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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