2

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.

1
  • 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, 2013 at 8:26

1 Answer 1

4

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .