Hello,
I am using opensuse 12.1 and I am trying to have x11vnc started before login.
I have created a /etc/init.d/vnc 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} -nopw -unixpw -shared -oa /var/log/vnc.log -xkb -bg -verbose "
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 ${CMD}
sleep 2s
# Remember status and be verbose.
rc_status -v
;;
*)
echo -e "Usage: ${SERVICE} {start}"
exit 1
;;
esac
rc_exit
When launching it from the command line it works but it doesn’t on boot.
Here x11vnc log file :
02/07/2012 19:00:49 x11vnc version: 0.9.12 lastmod: 2010-09-09 pid: 1002
02/07/2012 19:00:49 XOpenDisplay(":0") failed.
02/07/2012 19:00:49 Trying again with XAUTHLOCALHOSTNAME=localhost ...
02/07/2012 19:00:49 ***************************************
02/07/2012 19:00:49 *** XOpenDisplay failed (:0)
*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.
Do I have to change the priority of boot scripts ?
Any idea ?
Thanks