How do I restore deleted rc.local file?
12,167
The solution is to create a new rc.local
through:
gksudo gedit /etc/rc.local
paste the code:
#!/bin/sh -e
#
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
Make it executable:
sudo chmod +x /etc/rc.local
Related videos on Youtube
Comments
-
Venem over 1 year
I have recently inserted some strings into a script to be loaded on startup through
/etc/rc.local
. One of them was:xbacklight -set 50
. This led to Ubuntu refusing to go past login screen so I was forced to remove both files- the script andrc.local
.The question is how do I restore the
rc.local
file in order to be able to start over with the script?I am running Ubuntu 12.10 with kernel 3.7.8.
-
catalesia about 11 yearsBy default
rc.local
does nothing. To restore it you might simply create rc.local in /etc containingexit 0
only. This will restore the default rc.local Quote:#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. exit 0
This actually leads to a notion that perhaps your script does not exit with 0 or any other error?
-