#! /bin/sh ### BEGIN INIT INFO # Provides: X4VDR # Required-Start: $local_fs # Required-Stop: vdr # Default-Start: 2 # Default-Stop: # Short-Description: X-Server for VDR # Description: Starts the X-Server for the VDR. ### END INIT INFO # # Author: Helmar Gerloni # Version: 2006-09-13 # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="X-Server for VDR on VT8/Display 1" NAME=X4VDR PIDFILE=/var/run/$NAME\.pid SCRIPTNAME=/etc/init.d/$NAME # Gracefully exit if the VDR package has been removed. test -x /usr/sbin/runvdr || exit 0 # # Function that starts X. # d_start() { start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --exec /usr/bin/X -- :1 vt8 -br -nolisten tcp if [ $? -gt 0 ]; then echo "Error starting X-Server." exit $? fi } # # Function that stops X. # d_stop() { start-stop-daemon --stop --quiet --pidfile $PIDFILE if [ $? -gt 0 ]; then echo "Error stopping X-Server." fi } case "$1" in start) echo -n "Starting $DESC: $NAME" d_start echo "." ;; stop) echo -n "Stopping $DESC: $NAME" d_stop echo "." ;; restart|force-reload) echo -n "Restarting $DESC: $NAME" d_stop sleep 2 d_start echo "." ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0