如题,系统是opensuse 12.3,init.d下x11vnc的启动脚本,能启动x11vnc,但是无法创建pid file
脚本具体如下:
#!/bin/sh
#
# /etc/init.d/vnc
#
### BEGIN INIT INFO
# Provides: x11vnc server
# Required-Start: xdm
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start: 5
# Default-Stop: 0 1 2 6
# Short-Description:
# Description: Start or stop vnc server
### END INIT INFO
#INIT SCRIPT VARIABLES
SERVICE=$(basename $0)
PIDFILE="/var/run/${SERVICE}.pid "
BIN="/usr/bin/x11vnc "
AUTH=`ps wwaux | grep '/X.*-auth' | grep -v grep | sed -e 's/^.*-auth *//' -e 's/ .*$//' | head -n 1`
OPT="-display :0 -auth ${AUTH} -forever -bg -nolookup -ping 60 -rfbauth /etc/x11vnc/x11vnc.pass -rfbport 5900 -shared -reopen -oa /var/log/x11vnc.log "
CMD=${BIN}${OPT}
. /lib/lsb/init-functions
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting ${SERVICE}..."
## Start daemon with startproc(8).
/sbin/startproc -p /var/run/x11vnc.pid ${CMD}
sleep 2s
# Remember status and be verbose.
rc_status -v
;;
stop)
echo -n "Shutting down ${SERVICE}..."
killproc -TERM ${BIN}
rc_status -v
;;
try-restart)
$0 status >/dev/null && $0 restart
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
echo -n "Reload service ${SERVICE}..."
checkproc ${BIN}
rc_status -v
;;
reload)
rc_status -v
;;
status)
echo -n "Checking for ${SERVICE}..."
checkproc ${BIN}
rc_status -v
;;
probe)
;;
*)
echo "Usage: ${BIN} {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit
请问该如何修改,才能使startproc创建pid文件呢?