2002-06-10 11:00:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Startup script for synergy server
|
|
|
|
#
|
|
|
|
# chkconfig: 5 98 02
|
2002-07-19 20:44:57 +00:00
|
|
|
# description: Starts/stops synergy server
|
2002-06-10 11:00:55 +00:00
|
|
|
#
|
|
|
|
# processname: synergyd
|
2002-07-19 20:44:57 +00:00
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: synergyd
|
|
|
|
# Required-Start: $network $syslog
|
|
|
|
# Required-Stop: $network $syslog
|
|
|
|
# Default-Start: 5
|
|
|
|
# Default-Stop: 0 1 2 3 6
|
|
|
|
# Description: Start synergy server daemon.
|
|
|
|
### END INIT INFO
|
|
|
|
|
|
|
|
SYNERGYD_BIN=/usr/sbin/synergyd
|
|
|
|
test -x $SYNERGYD_BIN || exit 5
|
2002-06-10 11:00:55 +00:00
|
|
|
|
|
|
|
# startup command line arguments
|
|
|
|
ARGS=
|
|
|
|
|
2002-07-19 20:44:57 +00:00
|
|
|
# load function library
|
|
|
|
if test -f /etc/rc.status; then
|
|
|
|
. /etc/rc.status
|
|
|
|
rc_reset
|
|
|
|
else
|
2002-06-10 11:00:55 +00:00
|
|
|
. /etc/rc.d/init.d/functions
|
2002-07-19 20:44:57 +00:00
|
|
|
function startproc ()
|
|
|
|
{
|
|
|
|
daemon $*
|
|
|
|
}
|
|
|
|
function checkproc ()
|
|
|
|
{
|
|
|
|
status $*
|
|
|
|
}
|
|
|
|
function rc_status ()
|
|
|
|
{
|
|
|
|
RETVAL=$?
|
|
|
|
}
|
|
|
|
function rc_exit ()
|
|
|
|
{
|
|
|
|
exit $RETVAL
|
|
|
|
}
|
|
|
|
fi
|
2002-06-10 11:00:55 +00:00
|
|
|
|
|
|
|
case "$1" in
|
2002-07-19 20:44:57 +00:00
|
|
|
start)
|
|
|
|
echo -n "Starting synergy server: "
|
|
|
|
startproc $SYNERGYD_BIN $ARGS
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
echo -n "Stopping synergy server: "
|
|
|
|
killproc -TERM $SYNERGYD_BIN
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
|
|
|
rc_status
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
echo -n "Checking for synergy server: "
|
|
|
|
checkproc $SYNERGYD_BIN
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: synergyd {start|stop|status|restart}"
|
|
|
|
exit 1
|
2002-06-10 11:00:55 +00:00
|
|
|
esac
|
|
|
|
|
2002-07-19 20:44:57 +00:00
|
|
|
rc_exit
|