fwnn/rcfkwnn

91 lines
2.2 KiB
Plaintext
Raw Normal View History

#! /bin/sh
# Copyright (c) 1996, 2000 S.u.S.E. GmbH Fuerth, Germany. All rights reserved.
#
# Author: Mike Fabian <mfabian@suse.de>, 2000
#
# /etc/init.d/fkwnn
#
### BEGIN INIT INFO
# Provides: fkwnn
# Required-Start: $network $remote_fs $named
# Required-Stop: $network $remote_fs $named
# Default-Start: 3 5
# Default-Stop:
# Description: Free Wnn Korean Server, for input of Korean
### END INIT INFO
. /etc/rc.status
FREE_KWNN_BIN=/usr/bin/kserver
test -x $FREE_KWNN_BIN || exit 5
# First reset status of this service
rc_reset
if [ ! -f /etc/FreeWnn/ko_KR/kserverrc ] ; then
echo "can't find /etc/FreeWnn/ko_KR/kserverrc"
# program is not configured
exit 6
fi
case "$1" in
start)
echo -n "Starting Free Wnn Korean Server"
if test -e /tmp/kd_sockV4 ; then
rm /tmp/kd_sockV4
fi
# redirect message
# "startproc: startproc: signal catched /usr/bin/kserver: Terminated
# to /dev/null
startproc -u wnn -q -t 1 $FREE_KWNN_BIN > /dev/null 2>&1
rc_status -v
;;
stop)
echo "Shutting down Free Wnn Korean Server"
# don't use 'kwnnkill', because this doesn't kill kserver
# if there are still clients.
killproc -TERM $FREE_KWNN_BIN
rc_status -v
if test -e /tmp/kd_sockV4 ; then
rm /tmp/kd_sockV4
fi
;;
try-restart)
$0 status >/dev/null && $0 restart
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
$0 stop && $0 start
rc_status
;;
reload)
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for Free Wnn Korean Server: "
checkproc $FREE_KWNN_BIN
rc_status -v
;;
full-status)
$0 status
rc_status
if test -x /usr/bin/kwnnstat ; then
/usr/bin/kwnnstat
else
echo "Full status not available, can't start \`/usr/bin/kwnnstat'"
fi
;;
*)
echo "Usage: $0 {start|stop|try-restart|restart|force-reload|reload|status|full-status}"
exit 1
;;
esac
rc_exit