Helst ska ni använda ett riktigt startup script.

Typ:

---------------------------------
#! /bin/sh
# Author: Feras H.
# based on a basic debian skeleton startup script
NCSNAME=newcs.i686 # your newcs bin version
NCSDIR="/usr/sbin" # your newcs binary directory full path
NCSCONF="/etc/newcs.xml" # xml config full path
NCSUSER=user # existing user that will run newcs daemon (you should
NOT use root !).
NCSNICE=10 # set the newcs daemon priority -20 (most favorable scheduling) to 19 (least favorable).
PATH=/usr/sbin:/usr/bin:/sbin:/bin # some unecessary default paths
DESC="NewCS-1.66 daemon" # dummy description
NAME=newcs # dummy name
DAEMON="$NCSDIR/$NCSNAME" # Daemon bin location
DAEMON_ARGS="-nd -c $NCSCONF" # Keep -nd in place, ssd will fork to background itself (required to get a proper pid file)
PIDFILE=/var/run/$NAME.pid # pid path
LOG=/var/log/$NAME.log # log path
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
if [ ! -x "$DAEMON" ]
then
echo "$DAEMON does not exist"
exit 0
fi
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --chuid $NCSUSER --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1

start-stop-daemon --start --verbose --nicelevel $NCSNICE --make-pidfile --background --chuid $NCSUSER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS 2>&1 >> $LOG \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
return $?
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NCSNAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}

case "$1" in
start)
echo "Starting $DESC"
do_start
case "$?" in
0) log_daemon_msg "Success"
log_end_msg 0;;
1) log_daemon_msg "Already running"
log_end_msg 1;;
2) log_daemon_msg "Failed"
log_end_msg 2;;
esac
;;
stop)
echo "Stopping $DESC"
do_stop
case "$?" in
0|1) echo "Success" ;;
2) echo "Failed !" ;;
esac
;;
restart)
log_daemon_msg "Restarting $DESC"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
exit 3
;;
esac
:
--------------------------------------------

Lägg scriptet i /etc/init.d/scriptnamn
kör sedan chmod +x /etc/init.d/scriptnamn

Ändra variablerna NCSCONF, NCSUSER, NCSDIR, NCSNAME till er konfiguration.

Sen kör ni update-rc.d scriptnamn default

Då kan man även skriva /etc/init.d/scriptnamn restart|start|stop