diff -Nru flashcam-1.4.4/debian/changelog flashcam-1.4.4/debian/changelog --- flashcam-1.4.4/debian/changelog 2010-03-29 23:08:33.000000000 +0100 +++ flashcam-1.4.4/debian/changelog 2010-03-30 18:33:10.000000000 +0100 @@ -1,3 +1,9 @@ +flashcam (1.4.4-0ubuntu~ppa2l) lucid; urgency=low + + * Fix & improve init script + + -- Irving Popovetsky Tue, 30 Mar 2010 10:31:56 -0700 + flashcam (1.4.4-0ubuntu~ppa1l) lucid; urgency=low * Update to version 1.4.4 diff -Nru flashcam-1.4.4/debian/flashcam.default flashcam-1.4.4/debian/flashcam.default --- flashcam-1.4.4/debian/flashcam.default 2009-10-05 18:24:49.000000000 +0100 +++ flashcam-1.4.4/debian/flashcam.default 2010-03-30 18:29:19.000000000 +0100 @@ -1,3 +1,4 @@ RUN=yes PERMISSIVE_DEV=yes RUN_NANNY=yes +DAEMON_OPTS="-s 640x480 -D" # Additional options given to the server diff -Nru flashcam-1.4.4/debian/flashcam.init flashcam-1.4.4/debian/flashcam.init --- flashcam-1.4.4/debian/flashcam.init 2009-10-05 18:24:49.000000000 +0100 +++ flashcam-1.4.4/debian/flashcam.init 2010-03-30 18:31:22.000000000 +0100 @@ -45,7 +45,7 @@ # Default options, these can be overriden by the information # at /etc/default/$NAME -DAEMON_OPTS="-s 640x480 -D" # Additional options given to the server +#DAEMON_OPTS="-s 640x480 -D" # Now set in /etc/default/flashcam DIETIME=10 # Time to wait for the server to die, in seconds # If this value is set too low you might not @@ -62,7 +62,7 @@ # when it actually did) LOGFILE=$LOGDIR/$NAME.log # Server logfile -#DAEMONUSER=flashcam # Users to run the daemons as. If this value +#DAEMONUSER=root # Users to run the daemons as. If this value # is set start-stop-daemon will chuid the server # Include defaults if available @@ -146,24 +146,24 @@ echo "***** Starting Flashcam at ${CURRDATE}" >> $LOGFILE start_daemon $DAEMON $DAEMON_OPTS >> $LOGFILE 2>&1 errcode=$? - # Manually record the pidfile - ?? needed ?? + # Manually record the pidfile sleep 1 - FC_PID=`ps -C flashcam -o pid= | tail -1` + FC_PID=`ps -C flashcam -o pid,cmd= | grep '/usr/bin/flashcam' | awk '{print $1}'` echo "${FC_PID}" > $PIDFILE else # if we are using a daemonuser then change the user id - echo "***** Starting Flashcam at ${CURRDATE}" >> $LOGFILE + echo "***** Starting Flashcam as $DAEMONUSER at ${CURRDATE}" >> $LOGFILE start-stop-daemon --start --quiet \ --chuid $DAEMONUSER \ --exec $DAEMON -- $DAEMON_OPTS errcode=$? - # Manually record the pidfile - ?? needed ?? + # Manually record the pidfile sleep 1 - FC_PID=`ps -C flashcam -o pid= | tail -1` + FC_PID=`ps -C flashcam -o pid,cmd= | grep '/usr/bin/flashcam' | awk '{print $1}'` echo "${FC_PID}" > $PIDFILE fi # continue if no errors - if [ ${errcode} > 0]; then + if [ ${errcode} > 0 ]; then return $errcode fi # Set 666 permissions on video devices if requested, for @@ -313,31 +313,6 @@ log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" log_warning_msg "cannot re-read the config file (use restart)." ;; - # And this if it cann - #reload) - # - # If the daemon can reload its config files on the fly - # for example by sending it SIGHUP, do it here. - # - # If the daemon responds to changes in its config file - # directly anyway, make this a do-nothing entry. - # - # log_daemon_msg "Reloading $DESC configuration files" "$NAME" - # if running ; then - # reload_server - # if ! running ; then - # Process died after we tried to reload - # log_progress_msg "died on reload" - # log_end_msg 1 - # exit 1 - # fi - # else - # log_progress_msg "server is not running" - # log_end_msg 1 - # exit 1 - # fi - #;; - *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2