/etc/rc.local is not executed at startup

Bug #471266 reported by Christoph Korn
60
This bug affects 11 people
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
New
Undecided
Unassigned
Nominated for Karmic by Vivien GUEANT
Nominated for Lucid by Vivien GUEANT

Bug Description

Binary package hint: upstart

The /etc/rc.local is not executed in karmic.

I use the script to mute the sound with:
amixer set Master 50% mute

But on karmic the sound is not muted which means that the script is not been run.

There is also a thread on ubuntuforums about that.

http://ubuntuforums.org/showthread.php?t=1289053

ProblemType: Bug
Architecture: amd64
Date: Mon Nov 2 17:36:35 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: upstart 0.6.3-10
ProcEnviron:
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: upstart
Uname: Linux 2.6.31-14-generic x86_64

Revision history for this message
Christoph Korn (c-korn) wrote :
affects: upstart (Ubuntu) → sysvinit (Ubuntu)
Revision history for this message
EricDHH (ericdhh) wrote :

Confirmed!

No ssd tweaks, no scheduler settungs or the thinkpad osd workaround give any reaction. The /etc/rc.local is not executed.

My t42 was installed from scratch with karmic, no update.

Eric

Revision history for this message
Christoph Scheingraber (chris-scheingraber) wrote :

Same problem here, after upgrading from 9.04 to 9.10, the rc.local is not executed (at the end of startup) anymore. The execution bit is set:
-rwxr-xr-x 1 root root 351 2009-06-29 15:32 /etc/rc.local

The service is also still included in the runlevel directory.

Revision history for this message
EricDHH (ericdhh) wrote :

Fiddling around with echo messages i found a logic in that, please check. The rc.local was executed till first error or unclean finished call, that will stop all execution of further lines. Is this a bug or wanted behaviour?

Revision history for this message
bert_3262b (bert-rijsdijk-gmail) wrote :

I have the exact same problem in 9.10. rc.local doesn't run. However, it does run when I start in manaully.

My system was upgraded from 9.04, no tweaks in files in /etc/rc.xx

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Same problem here: I used to use the rc.local script to set some energy saving parameters on my netbook. But since the upgrade (fresh install) to 9.10 the rc.local does not run anymore.

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

By the way, this bugs may be related:

Scripts in /etc/rc2.d/ are not executed
https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/453473

After upgrade to karmic cups server do not start.
https://bugs.launchpad.net/ubuntu/+bug/444597

Revision history for this message
mutewit (amitsaraff) wrote :

I just stumbled across this bug on a fresh install of Karmic Koala on my Lenovo Thinkpad T400(Model 2767-BK1). The script runs fine when executed from a command line but fails to run on system startup.

I have seen various web-pages advising the removal of the '-e' switch on the #!/bin/sh line but that did not help.

-rwxr-xr-x 1 root root 589 2009-12-15 18:39 /etc/rc.local
lrwxrwxrwx 1 root root 18 2009-11-17 12:34 /etc/rc2.d/S99rc.local -> ../init.d/rc.local
-rwxr-xr-x 1 root root 801 2009-09-07 14:58 /etc/init.d/rc.local

Revision history for this message
Brad Johnson (kkhww1902) wrote :
Revision history for this message
Thomy23 (thomas-stather) wrote :

I can confirm this bug, for me the rc.local isn't exectued as well (it hast the rwx-r-xr-x flag)

OS: Ubuntu 9.10 x86_64

ii upstart 0.6.3-10 event-based init daemon

Revision history for this message
LeeDaugherty (granfury83) wrote :

     While this might be a duplicate bug, this evening I ran across a minor "typo" on my part that was "preventing" my rc.local from running. Without anyone posting their rc.local I can't confirm if this is the same issue.
     In order to shut up my Microsoft keyboard rolling out keymap errors (due to its battery update polling) I needed to set some 'setkeycodes'. I put 'setkeycodes e001 254' etc... in my rc.local, rebooted...nothing. When I ran rc.local, it ran just fine. On a whim, I passed the full path to rc.local '/usr/bin/setkeycodes e001 254' and rebooted...and it works. I hope this helps, if not, disregard, eventhough the "duplicate" bug to me, has very little to do with the above postings.
     For the heck of it, I used the above amixer command as typed, and it doesn't work. /usr/bin/amixer does.

Revision history for this message
Richard Leger (richard-leger) wrote :

Maybe your rc.local script is executed but terminates unexpectidly du to the -e option in the shabang declaration
(e.g #!/bin/sh -e)

With this option, any command in the script returning an error (exit code other than 0) will stop execution of the rc.local script.

Those post might be of some help... or not...

http://ubuntuforums.org/showpost.php?p=9430202&postcount=33
http://forum.ubuntu-fr.org/viewtopic.php?pid=3535050#p3535050

Also adding a :
/bin/sleep 10
at the begin of the script might help ensuring that other part of the system are fully initialised before running rc.local commands...

Cheers!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.