Thursday, September 5, 2013

FEDORA systemctl start rc-local



Auto running commands at boot




Create the rc.local file in the /etc/rc.d directory, 
and make sure the first line is #!/bin/sh


/etc/rc.d/rc.local file also can start at the top with:

#!/bin/bash

Then activate this service with something like:
# systemctl enable rc-local.service

Make the rc.local file executable
# chmod 700 /etc/rc.d/rc.local


If there's problems : 
cat /var/log/messages | grep rc.local 

/etc/rc.d/rc.local is the place for the commands but you have to ensure the
rc-local service is enabled and running.



[root@gate depit]# 
[root@gate depit]# service rc-local status
Redirecting to /bin/systemctl status  rc-local.service
rc-local.service - /etc/rc.d/rc.local Compatibility
   Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static)
   Active: failed (Result: exit-code) since Wed 2013-11-27 23:22:57 EET; 42min ago
[root@gate depit]# 


/etc/rc.local does not get executed on sytem bootup
https://bugzilla.redhat.com/show_bug.cgi?id=843735
fedora systemd service "rc-local" ExecStart "code=exited" "status=7"


Description of problem:
/etc/rc.local is the script within whihc if any commands are found should get executed on bootup, but is not happening on Fedora 19

I am using Network-Manager. network daemon is switched off & ethernet interfaces are managed by NM only.

I think this will work for you if you do 'systemctl enable NetworkManager-wait-online.service'.

Getting Fedora 18, 19  to start the service can be done as root:
# systemctl start rc-local
# systemctl status rc-local

How to disable screen blanking on text console : 
if setterm command is put on rc.local , then it has no effect :
setterm -blank -0 
instead , add setterm -blank X (X in minutes, 0 to disable) to a shell init file like .bashrc.
after login , 
cat /sys/module/kernel/parameters/consoleblank 
returns 0 
http://unix.stackexchange.com/questions/8056/disable-screen-blanking-on-text-console
http://superuser.com/questions/152347/change-linux-console-screen-blanking-behavior


No comments:

Post a Comment