#! /bin/sh ### BEGIN INIT INFO # Provides: X4VDR # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Starts the X-Server for the VDR. # Description: Starts the X-Server for VDR (Linux Video Disk Recorder). ### END INIT INFO # # Author: Helmar Gerloni # Version: 2008-12-09 # 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