Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Аватара для dmitryst

Ветеран


Сообщения: 7317
Благодарности: 910

Профиль | Отправить PM | Цитировать


Всем спасибо, уже нашел решение . В /etc кладем этот скрипт (x11vnc_loop):
Код: Выделить весь код
#!/bin/sh
#
# x11vnc_loop:
#
# Example startup script for connecting x11vnc to an X display
# at system boot up and having it reconnect when the X server restarts.
#
# Run, in rc.local say, via, e.g.:
#
#	/path/to/x11vnc_loop 1>> /var/tmp/x11vnc_loop.log 2>&1 &
#
# call with argument "once" or a number to limit the number of loops.
# 
##########################################################################
# The following needs to be customized:
x11vnc_cmd=x11vnc		# or use full path (or set PATH).  так и оставил
pwfile=/etc/vncpass	# always use a password   - у меня он лежит тут
display=:0			# display of interest -  можно и другой, например :1
restart_sleep=5 		# pause between X server restarts.  -  задержка на рестарт иксов, если комп медленный, ставим больше

# modify cmdline args if desired:
x11vnc_args="-display $display -rfbauth $pwfile -forever -nap"

# you may need to customize the "grep", etc, below in get_xauthority_file()
##########################################################################

if [ "X$1" != "X" ]; then
	max=$1
	shift
fi

get_xauthority_file() {
	#
	# We need to find the MIT-COOKIE file... this not portable at all,
	# depends on OS, distro, desktop, phase of moon, etc...
	#
	# If the cookie file was fixed and you knew it, you could just
	# return it here e.g.:
	#
	## echo "/var/gdm/:0.Xauth"; return
	#
	# or, if you knew the directory, you could look for the youngest
	# file there and return it e.g.:
	#
	## echo `ls -t /var/lib/xdm/authdir/authfiles/* | head -1`; return

	# this hack tries to grep it out of ps output...

	xauth="/var/lib/xdm/authdir/authfiles/*"
# у меня этот файл лежит там, где он лежит в другом дистрибутиве смотрим так:
# ps wwwwaux | grep auth

		sleep 2	# wait a bit in case X server is restarting slowly.
#	done
	echo $xauth
}

try=1
while [ 1 ]
do
	echo "`date`  $0 try number: $try"; try=`expr $try + 1`

	auth=`get_xauthority_file`
	if [ ! -r "$auth" ]; then
		echo "`date`  bad auth file: \"$auth\""
	else
		cmd="$x11vnc_cmd $x11vnc_args"
		sleep 1
		echo "`date`  running: $cmd -auth $auth"
		# run x11vnc:
		$cmd -auth $auth
		if [ "X$max" = "Xonce" ]; then
			exit $?
		fi
	fi
	if echo "$max" | grep '[0-9]' > /dev/null; then
		if [ $try -gt $max ]; then
			exit
		fi
	fi
	sleep $restart_sleep
done
Делаем файл исполняемым и меняем пользователя/группу на root.
Далее, делаем фейк rc.local (описано тут ).
В конец добавляем строку - /etc/x11vnc_loop 1>> /var/tmp/x11vnc_loop.log 2>&1 &
Вроде, работет

-------
Осваиваю FreeBSD


Последний раз редактировалось dmitryst, 04-03-2009 в 19:28.


Отправлено: 12:31, 04-03-2009 | #2