#! /bin/sh ### BEGIN INIT INFO # Provides: Xxine # Required-Start: vdr # Default-Start: 2 # Default-Stop: # Short-Description: X-Server and Xine for VDR # Description: Starts the X-Server and Xine to display the VDR-picture. ### END INIT INFO # # Version: 2006-03-04 helmar@gerloni.net # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="X-Server and Xine for VDR on VT8/Display 1" NAME=Xxine PIDFILEX=/var/run/$NAME\_X.pid PIDFILEXINE=/var/run/$NAME\_xine.pid SCRIPTNAME=/etc/init.d/$NAME XXINEUSER=vdr # Gracefully exit if the VDR package has been removed. test -x /usr/sbin/runvdr || exit 0 # # Function that starts X and Xine. # d_start() { start-stop-daemon --start --background --pidfile $PIDFILEX --make-pidfile --chuid $XXINEUSER --exec /usr/bin/X11/X -- :1 vt8 -br -nolisten tcp if [ $? -gt 0 ]; then echo "Error starting X-Server." exit $? fi export DISPLAY=:1 # --post expand:centre_crop_out_mode=1 sometimes causes a blue screen or a jumping OSD on 19:6 material # Pay attention to the order of the options # MRL for Xine and vdr-plugin-xine without network patch: vdr://tmp/vdr-xine/stream#demux:mpeg_pes # MRL for Xine and vdr-plugin-xine with network patch: vdr-socket:/127.0.0.1#demux:mpeg_pes start-stop-daemon --start --background --pidfile $PIDFILEXINE --make-pidfile --chuid $XXINEUSER --exec /usr/bin/xine -- --fullscreen --no-logo --no-splash --no-gui --no-lirc --deinterlace --post vdr_video --post vdr_audio vdr://tmp/vdr-xine/stream#demux:mpeg_pes if [ $? -gt 0 ]; then echo "Error starting Xine." fi } # # Function that stops X and Xine. # d_stop() { start-stop-daemon --stop --quiet --pidfile $PIDFILEXINE if [ $? -gt 0 ]; then echo "Error stopping Xine." fi start-stop-daemon --stop --quiet --pidfile $PIDFILEX 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