Description of problem: mga7 # systemctl enable rc-local.service The unit files have no installation config (WantedBy=, RequiredBy=, Also=, Alias= settings in the [Install] section, and DefaultInstance= for template units). This means they are not meant to be enabled using systemctl. Possible reasons for having this kind of units are: • A unit may be statically enabled by being symlinked from another unit's .wants/ or .requires/ directory. • A unit's purpose may be to act as a helper for some other unit which has a requirement dependency on it. • A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, ...). • In case of template units, the unit is meant to be enabled with some instance name specified. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. systemctl enable rc-local.service Suggested fix, add the following to end of /usr/lib/systemd/system/rc-local.service [Install] WantedBy=multi-user.target
This is probably invalid. It's not meant to be enabled that way. If you create /etc/rc.d/rc.local, make it executable, and make sure it starts with #!/bin/sh or #!/bin/bash, then it should be automatically enabled.
(In reply to David Walser from comment #1) > This is probably invalid. It's not meant to be enabled that way. If you > create /etc/rc.d/rc.local, make it executable, and make sure it starts with > #!/bin/sh or #!/bin/bash, then it should be automatically enabled. Ok, I'll close it. I recommend that users should create their own service file with any desired directives. The service as is, does not correctly emulate old methodology. Case in point, running systemctl stop rc-local, does not run the script. Example: $ cat /etc/rc.d/rc.local #!/bin/bash echo "Running $0 with $1 "| systemd-cat -t rc.local -p info # systemctl start rc-local # systemctl stop rc-local # journalctl --no-hostname | grep rc.local Jan 08 22:07:34 systemd[1]: Started /etc/rc.d/rc.local Compatibility. Jan 08 22:07:34 rc.local[8661]: Running /etc/rc.d/rc.local with start Jan 08 22:21:30 systemd[1]: rc-local.service: Succeeded. Jan 08 22:21:30 systemd[1]: Stopped /etc/rc.d/rc.local Compatibility. Note that there is no xxxxx rc.local[8661]: Running /etc/rc.d/rc.local with stop indicating /etc/rc.d/rc.local was not executed. I opened this bug because of https://bugs.mageia.org/show_bug.cgi?id=24189 and the resulting rant/thread in Newsgroups: alt.os.linux.mageia Subject: Re: rc.local again On Sun, 5 Jan 2020 12:47:35 +1100, Doug Laidlaw Closing as wontfix, works as designed.
Resolution: (none) => WONTFIXStatus: NEW => RESOLVED
Indeed it is working as it was meant to.
Resolution: WONTFIX => INVALID