I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 83972962 authored by kytv's avatar kytv
Browse files

Add 'graceful' / comment out stanza not needed on Ubuntu

parent 06d04125
No related branches found
No related tags found
No related merge requests found
...@@ -55,9 +55,19 @@ for ENV_FILE in /etc/environment /etc/default/locale; do ...@@ -55,9 +55,19 @@ for ENV_FILE in /etc/environment /etc/default/locale; do
value=`egrep "^${var}=" "$ENV_FILE" | tail -n1 | cut -d= -f2` value=`egrep "^${var}=" "$ENV_FILE" | tail -n1 | cut -d= -f2`
[ -n "$value" ] && eval export $var=$value [ -n "$value" ] && eval export $var=$value
if [ -n "$value" ] && [ "$ENV_FILE" = /etc/environment ]; then # This is commented out for Ubuntu: Ubuntu still creates
log_warning_msg "/etc/environment has been deprecated for locale information; use /etc/default/locale for $var=$value instead" # /etc/environment in the most recent release
fi # (currently 'Precise').
#
# TODO Add logic to automatically handle this
#
# Commented for Ubuntu since PPA packages 0.9-1$DISTRO1.
# Packages for Debian systems will have this stanza uncommented.
#
# if [ -n "$value" ] && [ "$ENV_FILE" = /etc/environment ]; then
# log_warning_msg "/etc/environment has been deprecated for locale information; use /etc/default/locale for $var=$value instead"
# fi
done done
done done
...@@ -124,6 +134,12 @@ do_dump() ...@@ -124,6 +134,12 @@ do_dump()
[ "$RETVAL" = 2 ] && return 2 [ "$RETVAL" = 2 ] && return 2
} }
do_graceful()
{
start-stop-daemon --stop --quiet -s HUP --pidfile $PIDFILE -u $I2PUSER
[ "$RETVAL" = 2 ] && return 2
}
case "$1" in case "$1" in
start) start)
log_daemon_msg "Starting $DESC" "$NAME" log_daemon_msg "Starting $DESC" "$NAME"
...@@ -141,6 +157,15 @@ case "$1" in ...@@ -141,6 +157,15 @@ case "$1" in
2) log_end_msg 1 ;; 2) log_end_msg 1 ;;
esac esac
;; ;;
graceful)
log_daemon_msg "Attempting graceful shutdown of $DESC" "$NAME"
log_daemon_msg "(could take up to 11 minutes)"
do_graceful
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
stop) stop)
log_daemon_msg "Stopping $DESC" "$NAME" log_daemon_msg "Stopping $DESC" "$NAME"
do_stop do_stop
...@@ -172,7 +197,7 @@ case "$1" in ...@@ -172,7 +197,7 @@ case "$1" in
;; ;;
*) *)
N=/etc/init.d/$NAME N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|dump|status|restart|force-reload}" >&2 echo "Usage: $N {start|stop|dump|graceful|status|restart|force-reload}" >&2
exit 3 exit 3
;; ;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment