# systemctl enable rc-local 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, ...).
So, what does a user do in order to make the system start (execute) /etc/rc.d/rc.local at (or shortly thereafter) boot up??
On 12/17/2015 01:20 PM, jd1008 wrote:
So, what does a user do in order to make the system start (execute) /etc/rc.d/rc.local at (or shortly thereafter) boot up??
The rc-local.service is supposed to be automatically enabled if /etc/rc.d/rc.local exists and is executable.
systemctl status rc-local
will tell you if it is, and if it exited properly the last time it was invoked. (N.B. that it won't be invoked if you haven't rebooted after enabling it.)
On 12/17/2015 02:32 PM, Joe Zeff wrote:
On 12/17/2015 01:20 PM, jd1008 wrote:
So, what does a user do in order to make the system start (execute) /etc/rc.d/rc.local at (or shortly thereafter) boot up??
The rc-local.service is supposed to be automatically enabled if /etc/rc.d/rc.local exists and is executable.
systemctl status rc-local
will tell you if it is, and if it exited properly the last time it was invoked. (N.B. that it won't be invoked if you haven't rebooted after enabling it.)
$ sudo systemctl -l status rc-local rc-local.service - /etc/rc.d/rc.local Compatibility Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled) <<<<< DISABLED ???? Active: active (exited) since Thu 2015-12-17 12:21:21 MST; 2h 16min ago <<<<< Active??? How??? It says it is disabled!!! I do have the executable /etc/rc.d/rc.local shell script.
Dec 17 12:21:18 localhost.localdomain polkitd[1221]: Loading rules from directory /usr/share/polkit-1/rules.d Dec 17 12:21:18 localhost.localdomain polkitd[1221]: Finished loading, compiling and executing 10 rules Dec 17 12:21:18 localhost.localdomain polkitd[1221]: Lost the name org.freedesktop.PolicyKit1 - exiting Dec 17 12:21:19 localhost.localdomain rc.local[1166]: Setting cpu: 0 Dec 17 12:21:19 localhost.localdomain rc.local[1166]: Setting cpu: 1 Dec 17 12:21:19 localhost.localdomain rc.local[1166]: Setting cpu: 2 Dec 17 12:21:19 localhost.localdomain rc.local[1166]: Setting cpu: 3 Dec 17 12:21:21 localhost.localdomain rc.local[1166]: Failed to stop audit.service: Unit audit.service not loaded. Dec 17 12:21:21 localhost.localdomain rc.local[1166]: Failed to stop auditd.service: Operation refused, unit auditd.service may be requested by dependency only. Dec 17 12:21:21 localhost.localdomain systemd[1]: Started /etc/rc.d/rc.local Compatibility.
On 12/18/15 05:52, jd1008 wrote:
$ sudo systemctl -l status rc-local rc-local.service - /etc/rc.d/rc.local Compatibility Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled) <<<<< DISABLED ???? Active: active (exited) since Thu 2015-12-17 12:21:21 MST; 2h 16min ago <<<<< Active??? How??? It says it is disabled!!! I do have the executable /etc/rc.d/rc.local shell script.
This is "normal". I have the same output with a working rc.local.
I have run into this situation where I thought it wasn't working. But it turned out to be a problem with the commands being run.
To see if you have a similar issue, just add a "touch" command in the rc.local and reboot. Then check to make sure the touch was successful.
On 12/17/2015 01:58 PM, Ed Greshko wrote:
This is "normal". I have the same output with a working rc.local.
[joe@khorlia ~]$ systemctl status rc-local rc-local.service - /etc/rc.d/rc.local Compatibility Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static) Active: active (exited) since Tue 2015-11-03 00:42:24 PST; 1 months 14 days ago
On 12/17/2015 02:58 PM, Ed Greshko wrote:
On 12/18/15 05:52, jd1008 wrote:
$ sudo systemctl -l status rc-local rc-local.service - /etc/rc.d/rc.local Compatibility Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled) <<<<< DISABLED ???? Active: active (exited) since Thu 2015-12-17 12:21:21 MST; 2h 16min ago <<<<< Active??? How??? It says it is disabled!!! I do have the executable /etc/rc.d/rc.local shell script.
This is "normal". I have the same output with a working rc.local.
I have run into this situation where I thought it wasn't working. But it turned out to be a problem with the commands being run.
To see if you have a similar issue, just add a "touch" command in the rc.local and reboot. Then check to make sure the touch was successful.
Yep. It touched. Thanx!!
On 12/17/2015 01:52 PM, jd1008 wrote:
$ sudo systemctl -l status rc-local rc-local.service - /etc/rc.d/rc.local Compatibility Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled) <<<<< DISABLED ???? Active: active (exited) since Thu 2015-12-17 12:21:21 MST; 2h 16min ago <<<<< Active??? How??? It says it is disabled!!! I do have the executable /etc/rc.d/rc.local shell script.
First off, it's a waste of time using sudo for this; systemctl status doesn't need root. Second, have you checked to make sure that the permissions on the script are what you think they are and that the contents are correct? (My version starts with #! /bin/bash and works just fine.)
On 12/17/2015 03:05 PM, Joe Zeff wrote:
On 12/17/2015 01:52 PM, jd1008 wrote:
$ sudo systemctl -l status rc-local rc-local.service - /etc/rc.d/rc.local Compatibility Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled) <<<<< DISABLED ???? Active: active (exited) since Thu 2015-12-17 12:21:21 MST; 2h 16min ago <<<<< Active??? How??? It says it is disabled!!! I do have the executable /etc/rc.d/rc.local shell script.
First off, it's a waste of time using sudo for this; systemctl status doesn't need root. Second, have you checked to make sure that the permissions on the script are what you think they are and that the contents are correct? (My version starts with #! /bin/bash and works just fine.)
To all your questions: yes. Script is executable in the manner you describe #!/bin/bash
On 12/17/2015 02:59 PM, jd1008 wrote:
To all your questions: yes. Script is executable in the manner you describe #!/bin/bash
What I meant was, did ls -l show it to be executable? Of course, now that you've confirmed (in a different post) that you know it runs, the question becomes redundant.
On Thu, Dec 17, 2015 at 2:52 PM, jd1008 jd1008@gmail.com wrote:
vendor preset: disabled) <<<<< DISABLED ????
I'm still learning all the ins and outs of systemd, but I think "vendor preset" means whether or not it would have been disabled with no local sysadmin action. I have a number of services that are installed disabled but I have enabled and they are working as they should. Example:
systemctl status bacula-fd ● bacula-fd.service - Bacula-FileDaemon, a Backup-client Loaded: loaded (/usr/lib/systemd/system/bacula-fd.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2015-12-15 08:59:41 MST; 2 days ago
I did "systemctl enable bacula-fd", and it does start automatically at every boot.
It is my understanding that the rc-local service will execute at every boot if the rc.local file exists and is executable. Here is what the comments in the rc-local.service file have to say:
# This unit gets pulled automatically into multi-user.target by # systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
--Greg
On 12/17/2015 03:11 PM, Greg Woods wrote:
On Thu, Dec 17, 2015 at 2:52 PM, jd1008 <jd1008@gmail.com mailto:jd1008@gmail.com> wrote:
vendor preset: disabled) <<<<< DISABLED ????
I'm still learning all the ins and outs of systemd, but I think "vendor preset" means whether or not it would have been disabled with no local sysadmin action. I have a number of services that are installed disabled but I have enabled and they are working as they should. Example:
I've already posted the status of rc-local.service on my computer and it doesn't show that. I've no idea why it does on your box, but as long as it works, it's probably not important.
On 12/17/2015 04:11 PM, Greg Woods wrote:
On Thu, Dec 17, 2015 at 2:52 PM, jd1008 <jd1008@gmail.com mailto:jd1008@gmail.com> wrote:
vendor preset: disabled) <<<<< DISABLED ????
I'm still learning all the ins and outs of systemd, but I think "vendor preset" means whether or not it would have been disabled with no local sysadmin action. I have a number of services that are installed disabled but I have enabled and they are working as they should. Example:
systemctl status bacula-fd ● bacula-fd.service - Bacula-FileDaemon, a Backup-client Loaded: loaded (/usr/lib/systemd/system/bacula-fd.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2015-12-15 08:59:41 MST; 2 days ago
I did "systemctl enable bacula-fd", and it does start automatically at every boot.
It is my understanding that the rc-local service will execute at every boot if the rc.local file exists and is executable. Here is what the comments in the rc-local.service file have to say:
# This unit gets pulled automatically into multi-user.target by # systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
--Greg
What executes /usr/lib/systemd/system-generators/systemd-rc-local-generator ? Manually by the user or automagically by the system?
On Thu, Dec 17, 2015 at 5:00 PM, jd1008 jd1008@gmail.com wrote:
What executes
/usr/lib/systemd/system-generators/systemd-rc-local-generator ? Manually by the user or automagically by the system?
"man systemd.generator" is enlightening:
DESCRIPTION Generators are small binaries that live in /usr/lib/systemd/user-generators/ and other directories listed above. systemd(1) will execute those binaries very early at bootup and at configuration reload time — before unit files are loaded.
On 12/17/2015 03:11 PM, Greg Woods wrote:
On Thu, Dec 17, 2015 at 2:52 PM, jd1008 <jd1008@gmail.com mailto:jd1008@gmail.com> wrote:
vendor preset: disabled) <<<<< DISABLED ????
I'm still learning all the ins and outs of systemd, but I think "vendor preset" means whether or not it would have been disabled with no local sysadmin action. I have a number of services that are installed disabled but I have enabled and they are working as they should. Example:
systemctl status bacula-fd ● bacula-fd.service - Bacula-FileDaemon, a Backup-client Loaded: loaded (/usr/lib/systemd/system/bacula-fd.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2015-12-15 08:59:41 MST; 2 days ago
I did "systemctl enable bacula-fd", and it does start automatically at every boot.
It is my understanding that the rc-local service will execute at every boot if the rc.local file exists and is executable. Here is what the comments in the rc-local.service file have to say:
# This unit gets pulled automatically into multi-user.target by # systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
rc-local.service will go into a "not running" state without saying why if it encounters any errors.
If you find yourself in that situation, run rc.local manually. This will allow you to see where it is failing. Make sure any terminating branches in conditional expressions return 0 when successful.