#!/bin/bash # $Header: /home/cvsd/magellan-cvs/magellan-src/mlivecdbuild/profiles/openvpn-i686/custom-files/single-x11.rc,v 1.1 2007-10-13 11:42:09 niro Exp $ #%rlevels: 5:s 0:k 1:k 2:k 3:k 4:k 6:k #%start: 95 #%stop: 05 #deps #%needs: #%before: #%after: source /etc/sysconfig/rc source $rc_functions case $1 in start) echo -e ${COLOREDSTAR}"Starting single X11 session ..." start-stop-daemon --start --background \ --make-pidfile /var/run/single-x11.pid \ --pidfile /var/run/single-x11.pid \ --exec /usr/sbin/single-x11 evaluate_retval update_svcstatus $1 splash svc_started "$(basename $0)" 0 ;; stop) echo -e ${COLOREDSTAR}"Stopping single X11 session ..." if [ -n "$(pidof xinit)" ] then CUR_VT=$(fgconsole) start-stop-daemon --stop --exec /usr/X11R6/bin/xinit evaluate_retval chvt ${CUR_VT} else # process not running; print a message print_status warning not_running fi [ -f /var/run/single-x11.pid ] && rm /var/run/single-x11.pid update_svcstatus $1 splash svc_stopped "$(basename $0)" 0 ;; restart) $0 stop sleep 1 $0 start ;; status) statusproc xinit ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac