LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-25-2011, 03:53 PM   #1
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Rep: Reputation: 21
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?
 
Old 09-25-2011, 08:34 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Did you try just to put it in rc.local and chmod +x rc.local?
 
Old 09-26-2011, 02:10 AM   #3
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with logging the output of a custom daemon with a custom init script d1s4st3r *BSD 3 04-30-2010 04:46 AM
clurgmgrd keeps runnings custom init.d script's status every 30 seconds or so Qwerty9119 Red Hat 1 10-17-2007 08:41 AM
custom init.d script will start but won't stop Qwerty9119 Red Hat 2 05-03-2007 12:51 PM
custom init.d script will start but won't stop Qwerty9119 Linux - General 2 05-03-2007 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration