Results 1 to 4 of 4
I looked at a few things on here about init scripts but none of them really help me out.
I understand the basic structure and I have the script created ...
- 06-30-2008 #1Just Joined!
- Join Date
- Jul 2005
- Location
- look out your window
- Posts
- 72
Init script help
I looked at a few things on here about init scripts but none of them really help me out.
I understand the basic structure and I have the script created fine.
The question I'm asking is is there a way to add an init script without using rc-update or chkconfig or a similar tool, as the script I'm writing is to be packaged with software designed to run on any distobution and it'd be a lot simpler to have one universal way of doing it rather than to be distro-specific.
Thanks,
ZDW
- 06-30-2008 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
In short, *nope*...but you can simplify it some...
The init scripts are usually stored in /etc/init.d, but then the run levels may be /etc/init.d/rcX or /etc/rcX. Your installer would have to check this.
You can copy your file into the /etc/init.d dir, chmod/chown, and then based on where the rc.d dir's are, create a symlink back to your /etc/init.d script - using capital S to start and capital K to kill when leaving that run level.
- 06-30-2008 #3Just Joined!
- Join Date
- Jul 2005
- Location
- look out your window
- Posts
- 72
sorry if I'm slow but what exactly do I need to do with the runlevels?
- 06-30-2008 #4Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
You need to understand how services get started via the init scripts in the different run levels. This is what chkconfig and rc-update are changing/editing.
Linux Boot - Init Scripts
The scripts in /etc/init.d are linked to by files in the run level folders like /etc/init.d/rc3.d. If the link starts with a capital S, then that service is started when run level 3 is entered.


Reply With Quote
