A typical runlevel script takes a parameter, which is usually "start" or "stop" (but might also support "reload", "status", "restart" and a few others, but "start" and "stop" are usually required). So a good runlevel script would look like:
Originally Posted by MK27
The part about linking it into /etc/rc.*/... is perfectly correct though.
case $1 in
EDIT: Some weird Linux distros don't use this system, but most of them do.
EDIT EDIT: The other problem is that runlevel scripts start the processes as root. Sometimes that is not what you want, and you have to play tricks.