Making rc.local work on F20.

R. G. Newbury newbury at mandamus.org
Mon Oct 27 14:51:05 UTC 2014


>> On Sat, 2014-10-25 at 21:25 -0400, Derrik Walker v2.0 wrote:
:
>> cd /etc
>> echo '#!/bin/bash' > rc.d/rc.local
>> ln -s rc.d/rc.local rc.local
>> chmod 755 rc.d/rc.local

As noted, previously you should use 'vi /etc/rc.d/rc.local' to add the 
'#!/bin/bash' line and any testing lines (like 'touch /var/tmp/hello')

After re-booting, check that the file 
/usr/lib/systemd/system/rc-local.service exists. It is *supposed* to be 
created when/if /etc/rc,d/rc.local exists and is executable *but* it may 
not. If it does not, then rc-local.service should contain:
*********************************
# rc-local.service
<snip>
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
[Unit]
Description=/etc/rc.d/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.d/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
RemainAfterExit=yes
SysVStartPriority=99
**********************************

You don't actually need the 'start' on the 4th last line. With this file 
in place and a systemctl enable rc-local.service' you should be good to go.

Note:
In my experience, this method is NOT stable. My guess is that, although 
the priority of 99 is supposed to be last, systemd has started processes 
which have not yet completed, when this is called, and things just fail. 
In particular, modules may get loaded in the wrong order, so that the 
hardware 'fails'. This sort of failure may not even be apparent in dmesg 
etc.

I have had success and stable results using the following line in 
*root's* crontab. (See Extensions in 'man 8 crontab')

@reboot  /etc/rc.d/rc.local

And disabling/masking the rc-local.service file so it is still there but 
not used.

This seems to depend entirely upon the hardware connected/installed in 
the computer. My desktop machine is fine with rc-local.service, but the 
mythtv box at home requires use of the crontab work-around to boot 
reliably with everything properly loaded. Note that I have to remove and 
re-install modules in rc.local to ensure the correct loading order. YMMV


              R. Geoffrey Newbury			



More information about the users mailing list