Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package virtuoso-opensource

Hi Release-Team!

We, the Qt/KDE team, would like you to check if the following changes
are within what you are expecting for getting an unblock.

The most important stuff was solving RC #704521 [2], but while looking at it I
found other issues. The complete list of changes in the init script is:

* I removed "set -e" from the script because (according to a footnote in
policy [1]) lsb/init-functions is incompatible with that option.
Furthermore, even the script itself did not deal with that option
correctly, e.g., a non-0 exit code from start-stop-daemon would have
terminated the script without proper logging. This also allowed for
simplification where the $errcode was used previously.

* The RC bug about stopping the daemon [2] is fixed in the stop_server
function by using start-stop-daemon with a proper --retry argument,
instead of killproc. The script has two modes of operation (one to use
root, one with a dedicated user for the daemon), hence there are two
branches in stop_server - I did not simplify this to keep the diff smaller.

* The script used to INT the server due to [3], but according to
upstream documentation [4] TERM should be used in rc.d scripts, so
that's what it does now.

* I removed reload_server and the reload directive because virtuoso does
not support reloading (it used to print an error there, and then exit 0).

* I removed force-stop since (a) it's not mandated or even recommended
by anything (b) stop itself will already use KILL if TERM does not work
and (c) it essentially just duplicated the retry-functionality of
start-stop-daemon, but with way too long delays (60s).

* The changes for the restart directive ensure that the script handles
failure to stop the server appropriately. They also remove the 60s-delay
between stop and start (which is no longer needed now that stop_daemon
properly waits for virtuoso to quit).

[1] http://www.debian.org/doc/debian-policy/footnotes.html#f81
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=704521
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=632060
[4] http://docs.openlinksw.com/virtuoso/signalsandexitcodes.html

Diffstats:
 changelog                    |   15 ++++
 control                      |    5 -
 virtuoso-opensource-6.1.init |  131
++++++++++---------------------------------
 3 files changed, 49 insertions(+), 102 deletions(-)

Kind regards,
Ralf Jung
Debian Qt/KDE team

unblock virtuoso-opensource/6.1.4+dfsg1-7

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (990, 'testing'), (100, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.8.6 (SMP w/4 CPU cores)
diff -Nru virtuoso-opensource-6.1.4+dfsg1/debian/changelog virtuoso-opensource-6.1.4+dfsg1/debian/changelog
--- virtuoso-opensource-6.1.4+dfsg1/debian/changelog	2013-02-25 09:49:36.000000000 -0300
+++ virtuoso-opensource-6.1.4+dfsg1/debian/changelog	2013-04-06 10:29:22.000000000 -0300
@@ -1,3 +1,18 @@
+virtuoso-opensource (6.1.4+dfsg1-7) UNRELEASED; urgency=low
+
+  [ Lisandro Damián Nicanor Pérez Meyer ]
+  * Add Sune and myself to Uploaders.
+
+  [ 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
+  * Change maintainer to Debian Krap team
+  * Remove obsolete DM-Upload-Allowed
+
+ -- Debian Krap Maintainers <debian-qt-...@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 -Nru virtuoso-opensource-6.1.4+dfsg1/debian/control virtuoso-opensource-6.1.4+dfsg1/debian/control
--- virtuoso-opensource-6.1.4+dfsg1/debian/control	2013-02-02 01:57:32.000000000 -0300
+++ virtuoso-opensource-6.1.4+dfsg1/debian/control	2013-04-06 10:29:22.000000000 -0300
@@ -1,8 +1,9 @@
 Source: virtuoso-opensource
 Section: database
 Priority: optional
-Maintainer: José Manuel Santamaría Lema <panfa...@gmail.com>
-DM-Upload-Allowed: yes
+Maintainer: Debian Krap Maintainers <debian-qt-...@lists.debian.org>
+Uploaders: Lisandro Damian Nicanor Pérez Meyer <lisan...@debian.org>,
+ Sune Vuorela <s...@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 -Nru virtuoso-opensource-6.1.4+dfsg1/debian/virtuoso-opensource-6.1.init virtuoso-opensource-6.1.4+dfsg1/debian/virtuoso-opensource-6.1.init
--- virtuoso-opensource-6.1.4+dfsg1/debian/virtuoso-opensource-6.1.init	2013-01-21 22:45:48.000000000 -0300
+++ virtuoso-opensource-6.1.4+dfsg1/debian/virtuoso-opensource-6.1.init	2013-04-06 10:28:46.000000000 -0300
@@ -54,11 +54,6 @@
 # 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 @@
     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-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 @@
         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 @@
             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 @@
             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
-- 
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-kde-talk

Reply via email to