For those that got used to using the service script in RedHat (or another distribution) here is a very simple script. It will not run scripts without execute permissions (change the last line if you want to change this behavior).
Code:
#!/bin/sh
# Helper script for managin rc scripts
USAGE="Usage: `basename $0` service [start|stop|restart|status]"
VERSION="`basename $0` Version 0.1"
DIR=/etc/rc.d
PREFIX=rc.
if [ $# -eq 0 ]; then
echo "$USAGE" >$2
exit 1
fi
case "$1" in
--help | -h | --h*)
echo "$USAGE" >&2
exit 0
;;
--version | -v | -V)
echo "$VERSION" >&2
exit 0
;;
0 | 4 | 6 | K | M | S | rc.0 | rc.4 | rc.6 | rc.K | rc.M | rc.S)
echo "Invalid service" >&2
echo "$USAGE" >&2
exit 1
;;
esac
case "$2" in
status|start|restart|stop)
;;
*)
echo "$USAGE" >&2
exit 1
esac
if [ -f $DIR/$1 ]; then
SERVICE=$DIR/$1
elif [ -f $DIR/${PREFIX}${1} ]; then
SERVICE=$DIR/${PREFIX}${1}
else
echo "Service '$1' could not be found" >&2
echo "$USAGE" >&2
exit 1
fi
$SERVICE $2