rc.local executing scripts twice.

You think you have found a bug? Let us know about it.
Post Reply
User avatar
pwatk
Posts: 474
Joined: 14. Mar 2010, 23:56
Location: United Kingdom

rc.local executing scripts twice.

Post by pwatk »

This is a bit of a strange one but it happens on my server box (64 bit) and my laptop (32 bit).

The rc.local script on my laptop looks like this:

Code: Select all

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

# Start vboxdrv
# If you do not wish this to be executed here then comment it out,
# and the installer will skip it next time.
if [ -x /etc/rc.d/rc.vboxdrv ]; then
    /etc/rc.d/rc.vboxdrv start
fi

# Disable hard disk load cycling:
hdparm -B 254 /dev/sda

# Reload psmouse module for ALPS touchpads:
if [ "`lsmod | grep psmouse`" ]; then
    modprobe -r psmouse ; modprobe psmouse
fi

# Disable wifi power management (for ath9k cards):
if [ "`lsmod | grep ath9k`" ]; then
    iwconfig wlan0 power off
fi

# Enable hotplugging:
#modprobe pciehp
modprobe acpiphp
For some reason the VirtualBox script is executed twice.

At first I thought this was just the terminal printing the output twice but when I added a line to execute my rc.dhcpd script from rc.local on my server I realised the script was actually being executed twice.

Any ideas?
Image
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: rc.local executing scripts twice.

Post by damNageHack »

You can comment (or remove at all) those vbox lines in rc.local due to rc.vbox will be executed anyway. This seems to be an issue with the vbox installation script.
# Start vboxdrv
# If you do not wish this to be executed here then comment it out,
# and the installer will skip it next time.
#if [ -x /etc/rc.d/rc.vboxdrv ]; then
# /etc/rc.d/rc.vboxdrv start
#fi
Check if rc.vboxdrv is executable for root

Code: Select all

chmod u+x /etc/rc.d/rc.vboxdrv
Reboot and it should be executed only once. Though it should not matter twice executed, the start command will only verify if all is running already at the second call.
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: rc.local executing scripts twice.

Post by thenktor »

Salix will start every rc.* script at startup. You don't have to add a entry to rc.local.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: rc.local executing scripts twice.

Post by damNageHack »

thenktor wrote:Salix will start every rc.* script at startup. You don't have to add a entry to rc.local.
Those lines will be added automatically while installation with the vbox script..
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: rc.local executing scripts twice.

Post by thenktor »

OK, then just comment them out ;)
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
gapan
Salix Wizard
Posts: 6353
Joined: 6. Jun 2009, 17:40

Re: rc.local executing scripts twice.

Post by gapan »

thenktor wrote:Salix will start every rc.* script at startup. You don't have to add a entry to rc.local.
Exactly. That is what rc.services does. You shouldn't use rc.local for any rc script. You can control which services are run using servicesetup/gtkservicesetup.
Image
Image
User avatar
pwatk
Posts: 474
Joined: 14. Mar 2010, 23:56
Location: United Kingdom

Re: rc.local executing scripts twice.

Post by pwatk »

You learn something everyday :) .

I hadn't noticed the rc.services script before.
Image
Post Reply