diff -Nru aiccu-20070115/debian/aiccu.init.d aiccu-20070115/debian/aiccu.init.d --- aiccu-20070115/debian/aiccu.init.d 2010-08-26 22:11:10.000000000 +0200 +++ aiccu-20070115/debian/aiccu.init.d 1970-01-01 01:00:00.000000000 +0100 @@ -1,163 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: aiccu -# Required-Start: $local_fs $remote_fs $syslog $network $time $named -# Required-Stop: $local_fs $remote_fs $syslog $network $time $named -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: SixXS Automatic IPv6 Connectivity Client Utility -# Description: -# This client configures IPv6 connectivity without having to -# manually configure interfaces etc. A SixXS account or an account -# of another supported tunnel broker and at least one tunnel are -# required. These can be freely requested from the SixXS website -# at no cost. For more information about SixXS check their homepage. -### END INIT INFO - -# Original Author: Jeroen Massar -# Author: Reinier Haasjes -# - -# Do NOT "set -e" - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="SixXS Automatic IPv6 Connectivity Client Utility" -NAME=aiccu -DAEMON=/usr/sbin/$NAME -DAEMON_ARGS="" -PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -# Is aiccu enabled? -case "$AICCU_ENABLED" in - [Nn]*) - exit 0 - ;; -esac - -# -# Function that starts the daemon/service -# -do_start() -{ - # Verify that the configuration file exists - if [ ! -f /etc/aiccu.conf ]; then - log_failure_msg "AICCU Configuration file /etc/aiccu.conf doesn't exist" - exit 1; - fi - - # Verify that the configuration is correct - if [ `grep -c "^username" /etc/aiccu.conf 2>/dev/null` -ne 1 ]; then - log_failure_msg "AICCU is not configured, edit /etc/aiccu.conf first" - exit 1; - fi - - # Verify that it is in daemonize mode, otherwise it won't ever return - if [ `grep -c "^daemonize true" /etc/aiccu.conf 2>/dev/null` -ne 1 ]; then - log_failure_msg "AICCU is not configured to daemonize on run" - exit 1; - fi - - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- start \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON -- stop - [ "$?" = 2 ] && return 2 - # Many daemons don't delete their pidfiles when they exit. - rm -f $PIDFILE - return "$RETVAL" -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff -Nru aiccu-20070115/debian/aiccu.upstart aiccu-20070115/debian/aiccu.upstart --- aiccu-20070115/debian/aiccu.upstart 1970-01-01 01:00:00.000000000 +0100 +++ aiccu-20070115/debian/aiccu.upstart 2011-07-15 06:56:18.000000000 +0200 @@ -0,0 +1,78 @@ +# aiccu - SixXS Automatic IPv6 Connectivity Client Utility + +description "SixXS Automatic IPv6 Connectivity Client Utility" +author "Caleb Callaway " + +start on net-device-up IFACE!=lo +stop on runlevel [!2345] + +emits net-device-up +emits net-device-down + +env BIN=/usr/sbin/aiccu +env DESC="SixXS Automatic IPv6 Connectivity Client Utility" +env CFG=/etc/aiccu.conf +env LOGFILE="/tmp/aiccu.log" + +pre-start script + # read defaults + [ -f /etc/default/aiccu ] && . /etc/default/aiccu + + case "$AICCU_ENABLED" in + [Nn]*) + exit 0 + ;; + esac + + [ -x "$BIN" ] || exit 1 + + # Verify we can write the log file + if [ ! -f $LOGFILE ]; then + touch $LOGFILE + if [ "$?" -ne 0]; then + echo "Failed to create log file"; + exit 1; + fi + elif [ ! -w $LOGFILE ]; then + echo "Log file unwritable"; + exit 1; + fi + + # Verify that the configuration file exists + if [ ! -f $CFG ]; then + echo "AICCU Configuration file /etc/aiccu.conf doesn't exist" >> $LOGFILE + exit 1; + fi + + # Verify that the configuration is correct + if [ `grep -c "^username" /etc/aiccu.conf 2>/dev/null` -ne 1 ]; then + echo "AICCU is not configured, edit /etc/aiccu.conf first" >> $LOGFILE + exit 1; + fi + +end script + +script + # read defaults + [ -f /etc/default/aiccu ] && . /etc/default/aiccu + + date >> $LOGFILE + + # start + echo "Starting $DESC aiccu" >> $LOGFILE + echo "Command line: $BIN start $DAEMON_ARGS" >> $LOGFILE + + $BIN start $DAEMON_ARGS >> /tmp/aiccu.log 2>&1 + + initctl emit -n net-device-up IFACE=sixxs +end script + + +pre-stop script + echo "Stopping $DESC aiccu" >> $LOGFILE +end script + +post-stop script + echo "$DESC aiccu stopped" >> $LOGFILE + initctl emit -n net-device-down IFACE=sixxs +end script diff -Nru aiccu-20070115/debian/changelog aiccu-20070115/debian/changelog --- aiccu-20070115/debian/changelog 2011-02-28 22:09:17.000000000 +0100 +++ aiccu-20070115/debian/changelog 2012-02-29 08:44:11.000000000 +0100 @@ -1,3 +1,9 @@ +aiccu (20070115-14ubuntu2) oneiric; urgency=low + + * Use upstart instead of init.d (LP: #223825) + + -- Lars Duesing Wed, 29 Feb 2012 08:41:59 +0100 + aiccu (20070115-14ubuntu1) natty; urgency=low * debian/patches/01_binutils_gold.patch: diff -Nru aiccu-20070115/debian/patches/10_upstart.patch aiccu-20070115/debian/patches/10_upstart.patch --- aiccu-20070115/debian/patches/10_upstart.patch 1970-01-01 01:00:00.000000000 +0100 +++ aiccu-20070115/debian/patches/10_upstart.patch 2012-02-29 08:39:01.000000000 +0100 @@ -0,0 +1,13 @@ +Index: aiccu-20070115/doc/aiccu.conf +=================================================================== +--- aiccu-20070115.orig/doc/aiccu.conf 2012-02-29 08:38:25.197479671 +0100 ++++ aiccu-20070115/doc/aiccu.conf 2012-02-29 08:38:41.069524354 +0100 +@@ -31,7 +31,7 @@ + # file. The TIC server *will* automatically disable accounts which + # are detected to run in this mode. + # +-daemonize true ++daemonize false + + # Automatic Login and Tunnel activation? + automatic true diff -Nru aiccu-20070115/debian/patches/series aiccu-20070115/debian/patches/series --- aiccu-20070115/debian/patches/series 2011-02-28 22:11:57.000000000 +0100 +++ aiccu-20070115/debian/patches/series 2012-02-29 08:38:07.000000000 +0100 @@ -7,3 +7,4 @@ 06_syslog_openlog.patch 07_allow_tunnels.patch 09_binutils_gold.patch +10_upstart.patch