* Debian GNU/Linux 4.0 etch amd64 - vnc [#eeb5ac44]
-Xをvnc経由でのみ起動させるスクリプト。xdm/gdmは実行しないようにしておく必要があります。
~
** インストール [#la0fa089]
-必須パッケージ
apt-get install vnc4server
~
** 設定 [#l79678a1]
-/etc/init.d/gdm
exit 0;
~
-/etc/init.d/vnc4server
#!/bin/bash
#
# chkconfig: 345 96 04
# description: vnc4server
#
# Startup script for VNC4 Server
#
# ----- Save and Set Environment Variables --------------------------------
PROGDIR=/usr/bin
PROGUSER=root
#PROGUSER=user
UMASK_VALUE=002
LOCALE=ja_JP.eucJP
DISPLAYNUMBER=:0
OPTIONS=":0 -depth 16"
LOGFILE=/var/log/vnc/vnc4server.log
# ----- Define Function ---------------------------------------------------
start() {
su - ${PROGUSER} -c "umask ${UMASK_VALUE}; env LC_ALL=${LOCALE} ${PROGDIR}/vnc4server ${OPTIONS} ${DISPLAYNUMBER} 2>&1" 2>&1 >> ${LOGFILE}
}
stop() {
su - ${PROGUSER} -c "rm -f /tmp/.X0-lock"
su - ${PROGUSER} -c "rm -f /tmp/.X11-unix/X0"
su - ${PROGUSER} -c "umask ${UMASK_VALUE}; env LC_ALL=${LOCALE} ${PROGDIR}/vnc4server -kill ${DISPLAYNUMBER} 2>&1" 2>&1 >> ${LOGFILE}
}
# ----- Execute The Requested Command -------------------------------------
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
;;
*)
echo "Usage:"
echo " $0 (start|stop|restart)"
echo ""
echo "Commands:"
echo " start - Start server"
echo " stop - Stop server"
echo " restart - Restart server"
echo ""
;;
esac
exit 0
~
-起動スクリプト登録
update-rc.d vnc4server defaults 96 04
~
** 情報源 [#l44c4f40]
~