From 0c5a57f891c0736de1394e443c78d1204acdd35e Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Thu, 12 Feb 2009 12:39:10 -0500 Subject: [PATCH] actually use AUTOX_USER rather than the hardcoded olpc user Signed-off-by: Andres Salomon --- autox | 7 ++++++- debian/autox.init | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/autox b/autox index 02dcbab..245bc3b 100755 --- a/autox +++ b/autox @@ -3,13 +3,18 @@ TIMEOUT=20 PIDFILE=/var/run/autox.pid +if [ -z "$1" ]; then + echo "Usage: $0 " 1>&2 + exit 1 +fi + echo $$ > $PIDFILE trap "rm -f $PIDFILE; killall -9 startx" 0 fails=0 while true; do start_time=`date "+%s"` - openvt -w -- su -c startx olpc + openvt -w -- su -c startx $1 end_time=`date "+%s"` timediff=$((end_time-start_time)) diff --git a/debian/autox.init b/debian/autox.init index abe83a0..a5a697f 100755 --- a/debian/autox.init +++ b/debian/autox.init @@ -29,7 +29,8 @@ if [ -f /etc/default/$NAME ] ; then fi if [ -z "$AUTOX_USER" ]; then - log_failure_msg "No user specified in /etc/default/${NAME}." + log_failure_msg "No user specified in /etc/default/${NAME}" + exit 0 fi case "$1" in @@ -42,7 +43,7 @@ case "$1" in #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 + --exec $DAEMON -- $AUTOX_USER #start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS & log_end_msg $? -- 2.39.5