iro/MyIro_daemon
changeset 37 6e5bd561ddd0
parent 24 2119564de7a9
child 44 e20909e61588
equal deleted inserted replaced
36:178fd966423d 37:6e5bd561ddd0
     1 #! /bin/sh
     1 #! /bin/sh
     2 NAME="IRO"
     2 NAME="Iro"
     3 DEAMON=/home/sandy/svn/iro/MyIro
     3 HOMEDIR=/home/hefee
       
     4 DEAMON=${HOMEDIR}/bin/MyIro
     4 DEAMON_OPTS=""
     5 DEAMON_OPTS=""
     5 PID=/home/sandy/var/run/$NAME.pid
     6 PID=${HOMEDIR}/var/run/$NAME.pid
     6 
     7 
     7 test -x $DEAMON || exit 0
     8 test -x $DEAMON || exit 0
     8 
     9 
     9 . /lib/lsb/init-functions
    10 . /lib/lsb/init-functions
    10 
    11 
    11 case "$1" in
    12 case "$1" in
    12   start)
    13   start)
    13 	log_daemon_msg "Starting $NAME" $NAME
    14 	log_daemon_msg "Starting $NAME" $NAME
    14 	if start-stop-daemon --start --quiet --oknodo --pidfile $PID --make-pidfile --background --chuid sandy --group sandy --chdir /home/sandy/svn/iro --startas $DEAMON -- $DEAMON_OPTS; then
    15 	if start-stop-daemon --start --quiet --background --oknodo --pidfile $PID --make-pidfile --user hefee --group hefee --chdir ${HOMEDIR} --startas $DEAMON -- $DEAMON_OPTS; then
    15 	    log_end_msg 0
    16 	    log_end_msg 0
    16 	else
    17 	else
    17 	    log_end_msg 1
    18 	    log_end_msg 1
    18 	fi
    19 	fi
    19 	;;
    20 	;;
    39   *)
    40   *)
    40 	log_action_msg "Usage: $0 {start|stop|restart|status}"
    41 	log_action_msg "Usage: $0 {start|stop|restart|status}"
    41 	exit 1
    42 	exit 1
    42 esac
    43 esac
    43 
    44 
    44 exit 0
    45 exit 1