Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 and rc.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.

share|improve this question
1  
By default rc.local does nothing. To restore it you might simply create rc.local in /etc containing exit 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? –  catalesia Mar 13 '13 at 8:26

1 Answer 1

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.