[SCM] Git repository for pkg-virtuoso branch, wheezy, updated. debian/6.1.4+dfsg1-6-1-gb4c02a0
Ralf Jung
post at ralfj.de
Thu Apr 4 15:18:49 UTC 2013
The following commit has been merged in the wheezy branch:
commit b4c02a089f62a4896ee11298704d03967c520c88
Author: Ralf Jung <post at ralfj.de>
Date: Thu Apr 4 17:09:29 2013 +0200
init script: fix stopping and restarting, remove 'set -e'; change maintainer
diff --git a/debian/changelog b/debian/changelog
index b8ae589..8cfcc43 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+virtuoso-opensource (6.1.4+dfsg1-7) UNRELEASED; urgency=low
+
+ * Change maintainer to Debian Qt/KDE team
+ * Remove obsolete DM-Upload-Allowed
+
+ [ Ralf Jung ]
+ * init script: Use start-stop-daemon (Closes: 704521)
+ * init script: Do not use "set -e", that's incompatible with
+ lsb/init-scripts
+ * init script: Stop attemtping to restart when stopping failed
+
+ -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Thu, 04 Apr 2013 17:04:31 +0200
+
virtuoso-opensource (6.1.4+dfsg1-6) unstable; urgency=low
* Add safer-timeout.patch, avoids random FTBFS'es. These random FTBFS'es
diff --git a/debian/control b/debian/control
index 30dacb4..7e84de5 100644
--- a/debian/control
+++ b/debian/control
@@ -1,8 +1,7 @@
Source: virtuoso-opensource
Section: database
Priority: optional
-Maintainer: José Manuel Santamaría Lema <panfaust at gmail.com>
-DM-Upload-Allowed: yes
+Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>
Standards-Version: 3.9.3
Homepage: http://virtuoso.openlinksw.com/wiki/main/Main/
Vcs-Browser: https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=pkg-virtuoso/pkg-virtuoso.git
diff --git a/debian/virtuoso-opensource-6.1.init b/debian/virtuoso-opensource-6.1.init
index c5dfdca..f6e9a8c 100644
--- a/debian/virtuoso-opensource-6.1.init
+++ b/debian/virtuoso-opensource-6.1.init
@@ -54,11 +54,6 @@ test -x $DAEMON || exit 0
# at /etc/default/$NAME
DAEMON_OPTS="" # Additional options given to the server
-DIETIME=60 # Time to wait for the server to die, in seconds
- # If this value is set too low you might not
- # let some servers to die gracefully and
- # 'restart' will not work
-
STARTTIME=1 # Time to wait for the server to start, in seconds
# If this value is set each time the server is
# started (on start or restart) the script will
@@ -97,9 +92,6 @@ if [ -n "$DAEMONUSER" ] ; then
fi
fi
-
-set -e
-
running_pid() {
# Check if a given process pid's cmdline matches a given name
pid=$1
@@ -129,63 +121,35 @@ start_server() {
start-stop-daemon --start --quiet \
--user `id -un` \
--chdir $DBPATH --exec $DAEMON \
- -- $DAEMON_OPTS
- errcode=$?
+ -- $DAEMON_OPTS || return $?
else
# if we are using a daemonuser then change the user id
start-stop-daemon --start --quiet \
--user $DAEMONUSER --chuid $DAEMONUSER \
--chdir $DBPATH --exec $DAEMON \
- -- $DAEMON_OPTS
- errcode=$?
+ -- $DAEMON_OPTS || return $?
fi
# Write the pid file using the process id from virtuoso.lck
sed 's/VIRT_PID=//' $DBPATH/$SHORTNAME.lck > $PIDFILE
- return $errcode
+ return 0
}
stop_server() {
+# http://docs.openlinksw.com/virtuoso/signalsandexitcodes.html says TERM should be used by rc.d scripts, so we do
# Stop the process using the wrapper
if [ -z "$DAEMONUSER" ] ; then
- killproc -p $PIDFILE $DAEMON -INT
- errcode=$?
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE \
+ --user `id -un` \
+ --exec $DAEMON || return $?
else
# if we are using a daemonuser then look for process that match
- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE \
--user $DAEMONUSER \
- --exec $DAEMON
- errcode=$?
+ --exec $DAEMON || return $?
fi
rm -f $PIDFILE
- return $errcode
-}
-
-reload_server() {
- [ ! -f "$PIDFILE" ] && return 1
- pid=pidofproc $PIDFILE # This is the daemon's pid
- # Send a SIGHUP
- kill -1 $pid
- return $?
-}
-
-force_stop() {
-# Force the process to die killing it manually
- [ ! -e "$PIDFILE" ] && return
- if running ; then
- kill -15 $pid
- # Is it really dead?
- sleep "$DIETIME"s
- if running ; then
- kill -9 $pid
- sleep "$DIETIME"s
- if running ; then
- echo "Cannot kill $NAME (pid=$pid)!"
- exit 1
- fi
- fi
- fi
- rm -f $PIDFILE
+ return 0
}
@@ -219,9 +183,8 @@ case "$1" in
log_daemon_msg "Stopping $DESC" "$NAME"
if running ; then
# Only stop the server if we see it running
- errcode=0
- stop_server || errcode=$?
- log_end_msg $errcode
+ stop_server
+ log_end_msg $?
else
# If it's not running don't do anything
log_progress_msg "apparently not running"
@@ -229,30 +192,28 @@ case "$1" in
exit 0
fi
;;
- force-stop)
- # First try to stop gracefully the program
- $0 stop
- if running; then
- # If it's still running try to kill it more forcefully
- log_daemon_msg "Stopping (force) $DESC" "$NAME"
- errcode=0
- force_stop || errcode=$?
- log_end_msg $errcode
- fi
- ;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
- errcode=0
- stop_server || errcode=$?
- # Wait some sensible amount, some server need this
- [ -n "$DIETIME" ] && sleep $DIETIME
- start_server || errcode=$?
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- running || errcode=$?
- log_end_msg $errcode
+ stop_server
+ case "$?" in
+ 0|1)
+ start_server
+ case "$?" in
+ 0) [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
+ running # check if it still runs
+ log_end_msg $?
+ ;;
+ 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
;;
status)
-
log_daemon_msg "Checking status of $DESC" "$NAME"
if running ; then
log_progress_msg "running"
@@ -263,39 +224,9 @@ case "$1" in
exit 1
fi
;;
- # Use this if the daemon cannot reload
- reload)
- 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
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
--
Git repository for pkg-virtuoso
More information about the Pkg-virtuoso-commits
mailing list