#! /bin/sh ### BEGIN INIT INFO # Provides: autox # Required-Start: $local_fs $remote_fs # Required-Stop: $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Automatically start X on boot ### END INIT INFO # # Author: Andres Salomon # set -e PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/autox PIDFILE=/var/run/autox.pid NAME=autox DESC=autox test -x $DAEMON || exit 0 . /lib/lsb/init-functions AUTOX_USER="" if [ -f /etc/default/$NAME ] ; then . /etc/default/$NAME fi if [ -z "$AUTOX_USER" ]; then log_failure_msg "No user specified in /etc/default/${NAME}." fi case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" #x=$(readlink -f /dev/stdin) #echo "stdin: $x" > /tmp/blah #chown olpc /dev/tty7 # -- /dev/tty7 #start-stop-daemon --start --chuid olpc --verbose --background --make-pidfile --pidfile $PIDFILE --user olpc --exec $DAEMON -- /dev/tty7 #start-stop-daemon --start --verbose --background --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- /dev/tty7 start-stop-daemon --start --background --pidfile $PIDFILE \ --exec $DAEMON #start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS & log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo log_end_msg $? ;; restart|force-reload) $0 stop sleep 1 $0 start ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0