起動スクリプト
#!/bin/bash
#
# chkconfig: 345 96 04
# description: vncserver
#
# Startup script for VNC Server
#
# ----- Save and Set Environment Variables --------------------------------
PROGDIR=/usr/bin/vncserver
PROGUSER=developer
UMASK_VALUE=002
LOCALE=ja_JP.eucJP
DISPLAYNUMBER=0
# ----- Define Function ---------------------------------------------------
start() {
su - ${PROGUSER} -c "umask ${UMASK_VALUE}; LC_ALL=${LOCALE} ${PROGDIR} :${DISPLAYNUMBER}"
}
stop() {
su - ${PROGUSER} -c "umask ${UMASK_VALUE}; LC_ALL=${LOCALE} ${PROGDIR} -kill :${DISPLAYNUMBER}"
}
# ----- Execute The Requested Command -------------------------------------
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
;;
*)
echo "Usage:"
echo " $0 (start|stop|reload)"
echo ""
echo "Commands:"
echo " start - Start server"
echo " stop - Stop server"
echo " restart - Restart server"
echo ""
;;
esac
exit 0