Hallo,
Ich möchte einen vncserver während des Bootvorgangs (runlevel5) starten
der eine KDE Oberfläche anbietet.
Hierfür habe ich ein Script "vncserver" in /etc/init.d/ erstellt und
verlinkt. Das Script wird als /etc/init.d/rc5.d/S13vncserver ausgeführt
beim Booten.
Das Script startet im Prinzip nur den vncserver mit Parameter :1 und
zeigt das auch ordentlich auf demBildschirm während des Bootens an,
außerdem beendet das Script den vncserver wenn der Rechner
heruntergefahren wird.
Der komplette Inhalt des Scripts lautet
(Anleitung zur Installation:
http://www.linuxnetmag.com/de/issue8/m8installation801.html,
Script unter:
http://www.linuxnetmag.com/de/issue8/m8installation802.html#vncserver):
########################################
#! /bin/sh
#
# Author: Guenther Zander
#
# /etc/init.d/vncserver this Script
# /usr/sbin/rcvncserver Root-Link to this Script
# /usr/X11R6/bin/vncserver Program
#
#
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start vncserver for remote control
#
### END INIT INFO
test -r /etc/rc.config && . /etc/rc.config
# Check for missing binaries
FOO_BIN=/usr/X11R6/bin/vncserver
test -x $FOO_BIN || exit 5
# Set HOME of Root-User
HOME="/root"
export HOME
# Set ID for Connections
FOO_ID=1
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num><num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
# rc_active checks whether a service is activated by
symlinks
. /etc/rc.status
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
case "$1" in
start)
echo -n "Starting Vnc-Server with Terminal-ID $FOO_ID "
# Delete old PIDs
rm -f $HOME/.vnc/$HOSTNAME:$FOO_ID.pid
if [ -e $HOME/.vnc/$HOSTNAME:$FOO_ID.log ]; then
cat $HOME/.vnc/$HOSTNAME:$FOO_ID.log >>
/var/log/vncserver.log 2>&1
rm -f $HOME/.vnc/$HOSTNAME:$FOO_ID.log
fi
$FOO_BIN :$FOO_ID 2>&1
rc_status -v6
;;
stop)
echo -n "Shutting down Vnc-Server "
$FOO_BIN -kill :$FOO_ID 2>&1
cat $HOME/.vnc/$HOSTNAME:$FOO_ID.log >> /var/log/vncserver.log
2>&1
rm -f $HOME/.vnc/$HOSTNAME:$FOO_ID.log
rc_status -v2
;;
restart)
$0 stop
$0 start
rc_status
;;
status)
echo -n "Checking for service Vnc-Server on Terminal-ID $FOO_ID:
"
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Return value is slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
checkproc $FOO_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;
esac
rc_exit
########################################
In der Datei /root/.vnc/xstartup steht nur die Zeile
exec /opt/kde3/bin/startkde &
Der vncserver startet, und es ist möglich sich mit ihm zu verbinden.
Allerdings wird nur ein Bildschirm mit rotem Hintergrund (der
Suse-KDE-Root-Hintergrund?) und einem Mauspfeil angezeigt. Es gibt
keinen Login und keine Bedienelemente.
Kann es sein, dass in dem Moment in dem das Script den vncserver startet
noch nicht die nötigen Vorraussetzungen für einen kompletten Start von
KDE getroffen sind?
Wie kann ich einen vncserver mit KDE während des Bootens starten?
Ich würde mich über jede Hilfe freuen!
Mit freundlichem Gruß
Clemens Eckert