Bug 1260264

Summary: systemd rc-local.service as shipped does not work
Product: [Fedora] Fedora Reporter: Berend De Schouwer <berend.de.schouwer>
Component: systemdAssignee: systemd-maint
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 22CC: goodmirek, johannbg, jsynacek, lnykryn, msekleta, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-08 10:38:31 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 Berend De Schouwer 2015-09-05 10:59:22 UTC
Description of problem:

systemd ships with rc-local.service.  This file is for backwards compatibility with /etc/rc.d/rc.local.  As shipped, 'systemctl enable rc-local.service' fails, which means that systemd-rc-local-generator also fails.


Version-Release number of selected component (if applicable):

219-21.fc22

A quick google says that it's broken since 188.


How reproducible:

very


Steps to Reproduce:
1. create /etc/rc.d/rc.local
2. chmod +x /etc/rc.d/rc.local
3. systemctl enable rc-local.service (or systemd-rc-local-generator)

Actual results:

The unit files have no [Install] section. They are not meant to be enabled
using systemctl.


Expected results:

service enabled


Additional info:

missing:
[Install]
WantedBy=multi-user.target

tested on x86_64 and arm

rc.local is deprecated, but still very useful on some hardware.

Comment 1 Lukáš Nykrýn 2015-09-08 10:38:31 UTC
This works for me:

[root@notas ~]# touch /etc/rc.d/rc.local
[root@notas ~]# chmod +x /etc/rc.d/rc.local
[root@notas ~]# cat /etc/rc.d/rc.local
#!/bin/bash

date > /tmp/test

exit 0
[root@notas ~]# systemctl daemon-reload
[root@notas ~]# systemctl show -p WantedBy rc-local.service
WantedBy=multi-user.target

and after reboot
[root@notas ~]# cat /tmp/test
Út zář  8 11:02:36 CEST 2015