LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Need help installing a custom init script. (https://www.linuxquestions.org/questions/linux-general-1/need-help-installing-a-custom-init-script-904948/)

edbarx 09-25-2011 03:53 PM

Need help installing a custom init script.
 
I need to install a custom init script to turn on the laptop's back light (Acer Aspire 7715z). I copied the small script to /etc/init.d and made it executable by using chmod. My problem is that need init to call the script after udev. I have tried to install the script by update-rc.d script defaults which created a link in /etc/rcS.d but with the incorrect order. I also tried to brute force install the script by creating a link in /etc/rcS.d using ln --symbolic script-absolute-path link-name.

Both these approaches failed. The script is for Debian (Wheezy currently testing). The script is this:

------------------------------------
#!/bin/sh


### BEGIN INIT INFO
# Provides: bkltguard
# Required-Start: $udev
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: turns the back light on
# Description: this small script turns the
# laptop back light on. It is used to workaround
# the "modesetting kernel bug".
### END INIT INFO


setpci -s 00:02.0 F4.B=00
-----------------------------

What am I doing wrong?

andrewthomas 09-25-2011 08:34 PM

Did you try just to put it in rc.local and chmod +x rc.local?

edbarx 09-26-2011 02:10 AM

The problem with rc.local is that it is called at every runlevel change and I don't what that to happen. I only need my script to be executed just once when udev finishes its chores because it is after udev's initialisation that the problem is manifesting itself.

I think, my best option is to have a good look at the script that is called just after udev and mimic it. I also suspecting my script may be failing because currently init scripts are called concurrently and I must make sure my script is run after udev finishes its initialisation of /dev.


All times are GMT -5. The time now is 10:00 AM.