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.
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.
sorry if I'm slow but what exactly do I need to do with the runlevels?
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.