Your message dated Sat, 15 Oct 2016 18:54:12 +0000
with message-id <e1bvu60-0003lk...@franck.debian.org>
and subject line Bug#840636: fixed in influxdb 0.13.0+dfsg1-5
has caused the Debian Bug report #840636,
regarding influxdb: Improve and fix init script
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
840636: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840636
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: influxdb
Version: 0.13.0+dfsg1-4
Severity: normal
Tags: patch

Hi!

The attached file is a fixed and improveed init script for influxdb.
It removes things for which there's better guaranteed alternatives in
Debian and fixes few behavior nits.

Thanks,
Guillem
commit b5063ad4ff15aca76670f8635d292264fb34c3b1
Author: Guillem Jover <gjo...@sipwise.com>
Date:   Fri Sep 30 17:36:31 2016 +0200

    Fix init script

diff --git a/debian/influxdb.init b/debian/influxdb.init
index e9db2d0..71e54f8 100644
--- a/debian/influxdb.init
+++ b/debian/influxdb.init
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ### BEGIN INIT INFO
 # Provides:          influxdb
@@ -32,13 +32,13 @@ USER=influxdb
 GROUP=influxdb
 
 if [ -r /lib/lsb/init-functions ]; then
-    source /lib/lsb/init-functions
+    . /lib/lsb/init-functions
 fi
 
 DEFAULT=/etc/default/influxdb
 
 if [ -r $DEFAULT ]; then
-    source $DEFAULT
+    . $DEFAULT
 fi
 
 if [ -z "$STDOUT" ]; then
@@ -58,48 +58,6 @@ fi
 
 OPEN_FILE_LIMIT=65536
 
-function pidofproc() {
-    if [ $# -ne 3 ]; then
-        echo "Expected three arguments, e.g. $0 -p pidfile daemon-name"
-    fi
-
-    pid=$(pgrep -f $3)
-    local pidfile=$(cat $2)
-
-    if [ "x$pidfile" == "x" ]; then
-        return 1
-    fi
-
-    if [ "x$pid" != "x" -a "$pidfile" == "$pid" ]; then
-        return 0
-    fi
-
-    return 1
-}
-
-function killproc() {
-    if [ $# -ne 3 ]; then
-        echo "Expected three arguments, e.g. $0 -p pidfile signal"
-    fi
-
-    PID=`cat $2`
-
-    /bin/kill -s $3 $PID
-    while true; do
-        pidof `basename $daemon` >/dev/null
-        if [ $? -ne 0 ]; then
-            return 0
-        fi
-
-        sleep 1
-        n=$(expr $n + 1)
-        if [ $n -eq 30 ]; then
-            /bin/kill -s SIGKILL $PID
-            return 0
-        fi
-    done
-}
-
 # Process name ( For display )
 name=influxd
 desc=database
@@ -122,45 +80,10 @@ config=/etc/influxdb/influxdb.conf
 # If the daemon is not there, then exit.
 [ -x $daemon ] || exit 0
 
-function wait_for_startup() {
-    control=1
-    while [ $control -lt 5 ]
-    do
-        if [ ! -e $pidfile ]; then
-            sleep 1
-            control=$((control+1))
-        else
-            break
-        fi
-    done
-}
-
-function is_process_running() {
-    # Checked the PID file exists and check the actual status of process
-    if [ -e $pidfile ]; then
-        pidofproc -p $pidfile $daemon > /dev/null 2>&1 && status="0" || status="$?"
-        # If the status is SUCCESS then don't need to start again.
-        if [ "x$status" = "x0" ]; then
-            return 0
-        else
-            return 1
-        fi
-    else
-        return 1
-    fi
-}
-
 case $1 in
     start)
         log_daemon_msg "Starting $desc" "$name"
 
-        # Check if it's running first
-        is_process_running
-        if [ $? -eq 0 ]; then
-            log_end_msg 0
-            exit 0
-        fi
-
         # Bump the file limits, before launching the daemon. These will carry over to
         # launched processes.
         ulimit -n $OPEN_FILE_LIMIT
@@ -170,41 +93,22 @@ case $1 in
             exit 1
         fi
 
-        if which start-stop-daemon > /dev/null 2>&1; then
-            start-stop-daemon --chuid $GROUP:$USER --start --quiet --pidfile $pidfile --exec $daemon -- -pidfile $pidfile -config $config $INFLUXD_OPTS >>$STDOUT 2>>$STDERR &
-        else
-            su $USER -c "nohup $daemon -pidfile $pidfile -config $config $INFLUXD_OPTS >>$STDOUT 2>>$STDERR &"
-        fi
+        start-stop-daemon --start --quiet --oknodo --exec $daemon \
+          --chuid $GROUP:$USER --pidfile $pidfile --background \
+          -- -pidfile $pidfile -config $config $INFLUXD_OPTS \
+          >>$STDOUT 2>>$STDERR
 
-        wait_for_startup && is_process_running
-        if [ $? -ne 0 ]; then
-            log_progress_msg "$name process failed to start"
-            log_end_msg 1
-            exit 1
-        else
-            log_end_msg 0
-            exit 0
-        fi
+        log_end_msg $?
         ;;
 
     stop)
         log_daemon_msg "Stopping $desc" "$name"
 
         # Stop the daemon.
-        is_process_running
-        if [ $? -ne 0 ]; then
-            log_progress_msg "$name process is not running"
-            log_end_msg 0
-            exit 0 # Exit
-        else
-            if killproc -p $pidfile SIGTERM && /bin/rm -rf $pidfile; then
-                log_end_msg 0
-                exit 0
-            else
-                log_end_msg 1
-                exit 1
-            fi
-        fi
+        start-stop-daemon --stop --quiet --oknodo \
+          --exec $daemon --pidfile $pidfile
+
+        log_end_msg $?
         ;;
 
     restart|force-reload)
@@ -216,19 +120,7 @@ case $1 in
         ;;
 
     status)
-        log_daemon_msg "Checking status of $desc" "$name"
-
-        # Check the status of the process.
-        is_process_running
-        if [ $? -eq 0 ]; then
-            log_progress_msg "running"
-            log_end_msg 0
-            exit 0
-        else
-            log_progress_msg "apparently not running"
-            log_end_msg 1
-            exit 1
-        fi
+        status_of_proc $daemon $name
         ;;
 
     version)
@@ -237,7 +129,7 @@ case $1 in
 
     *)
         # For invalid arguments, print the usage message.
-        echo "Usage: $0 {start|stop|restart|status|version}"
+        echo "Usage: $0 {start|stop|force-reload|restart|status|version}"
         exit 2
         ;;
 esac

--- End Message ---
--- Begin Message ---
Source: influxdb
Source-Version: 0.13.0+dfsg1-5

We believe that the bug you reported is fixed in the latest version of
influxdb, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 840...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Alexandre Viau <av...@debian.org> (supplier of updated influxdb package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 15 Oct 2016 14:12:16 -0400
Source: influxdb
Binary: golang-github-influxdb-influxdb-dev influxdb-dev influxdb 
influxdb-client
Architecture: source all amd64
Version: 0.13.0+dfsg1-5
Distribution: unstable
Urgency: medium
Maintainer: Debian Go Packaging Team 
<pkg-go-maintain...@lists.alioth.debian.org>
Changed-By: Alexandre Viau <av...@debian.org>
Description:
 golang-github-influxdb-influxdb-dev - Scalable datastore for metrics, events, 
and real-time analytics.
 influxdb   - Scalable datastore for metrics, events, and real-time analytics
 influxdb-client - command line interface for InfluxDB
 influxdb-dev - Transitional package for golang-github-influxdb-influxdb-dev
Closes: 835336 840636
Changes:
 influxdb (0.13.0+dfsg1-5) unstable; urgency=medium
 .
   [ Alexandre Viau ]
   * Prepare upload
   * d/control: Add InfluxDB dependency on lsb-base (>= 3.0-6)
   * Remove unused hardening-no-relro override
 .
   [ Guillem Jover ]
   * Remove existing static files (Closes: #835336)
   * Improve and fix init script (Closes: #840636)
 .
   [ Tim Potter ]
   * Update influxdb-usage-client B-D to use backports
Checksums-Sha1:
 f8f7c64aec0eb22a6183bdbede8cc196782a2450 3338 influxdb_0.13.0+dfsg1-5.dsc
 a0a521b062f29488d72e628e6f95c69aa01a91d4 120368 
influxdb_0.13.0+dfsg1-5.debian.tar.xz
 b2c802149e3aea73c3ddf5181f401d6886477396 752358 
golang-github-influxdb-influxdb-dev_0.13.0+dfsg1-5_all.deb
 80a844247396ce3032e2e7cad8b5e3b1956f8209 1178060 
influxdb-client_0.13.0+dfsg1-5_amd64.deb
 cd99eba09c82c0d197fd805ffb863f54b4f24970 43664 
influxdb-dev_0.13.0+dfsg1-5_all.deb
 fe82e802b0ceade1fdb693b7e9e550f9d272a04c 2732742 
influxdb_0.13.0+dfsg1-5_amd64.deb
Checksums-Sha256:
 288ebbd6faa1abfb493337fd11f04e6d779e8a1e4351b1fb877d767b81cbadf8 3338 
influxdb_0.13.0+dfsg1-5.dsc
 f24eef5cb035e2cb02935a10d9f0e7cf949b8d6f6a1aa4dd61ac653d1c6998a8 120368 
influxdb_0.13.0+dfsg1-5.debian.tar.xz
 21d9c002f8157e90844b82019165929a7113f1a46c92db94a6445edc62a8f268 752358 
golang-github-influxdb-influxdb-dev_0.13.0+dfsg1-5_all.deb
 c2ad35b1f79a67de58f0b7bc7c478434b482b357ff14e6dc6dcbe07ae0fd6594 1178060 
influxdb-client_0.13.0+dfsg1-5_amd64.deb
 a3838bcd1b241f07ca95b9e1d272b2de9af0042722df392ce33b36b280ddab6a 43664 
influxdb-dev_0.13.0+dfsg1-5_all.deb
 4e5e46b7dc47509d30b93ccd77e8ef03b3423b4c11048bcc0bbe3f91f000d16e 2732742 
influxdb_0.13.0+dfsg1-5_amd64.deb
Files:
 a03102202a2354f09c9dd2c18838dc8a 3338 database extra 
influxdb_0.13.0+dfsg1-5.dsc
 8ff18bfce9135d11ca6e751e5f6f8c5d 120368 database extra 
influxdb_0.13.0+dfsg1-5.debian.tar.xz
 faba1b562801a7c0109feb1cbb04475b 752358 database extra 
golang-github-influxdb-influxdb-dev_0.13.0+dfsg1-5_all.deb
 77d742fd838dc81ed739d9c34bf06d4d 1178060 database extra 
influxdb-client_0.13.0+dfsg1-5_amd64.deb
 56cf51de6945071f2d4265b9b1c796de 43664 oldlibs extra 
influxdb-dev_0.13.0+dfsg1-5_all.deb
 e380e039602b9c8e61a0e40d4e385f8f 2732742 database extra 
influxdb_0.13.0+dfsg1-5_amd64.deb

-----BEGIN PGP SIGNATURE-----

iQIuBAEBCgAYBQJYAngtERxhdmlhdUBkZWJpYW4ub3JnAAoJEI8rETxlNcWnNJ0P
/371CeKzM0ZkUsndhVXkwCkqKZCGYOWGKUOa3YOkLeTpd2idNo6o7lmO90zqOk+l
hdupL6Z0hExAhf6HD1ju08sbhcK0Q2ZV7ePW4UezBNt6bROk6tgDOnPvetQSS8OW
uRTd6AlHE+uRmuH7vjmWjr7ZfJf7ruNuAhFlbmCnx9w12NvDreOcKI6p86kgOTh9
N4/HhkQp+0bYey6oa4dX5yb8NoAav4YiimOCmkoU9BAcAhZokB5VvJikmN6FC3lI
/mzo56l2uPDFP/jTGICyRHOMDEq3sqvlN86zBKxzGciSlCkE6KlAf6LIyCV6QZLL
8WT/N8QsTlFuWRoITUugHKyxOT7Dga9FkgZSA+3/qhqTeMFACbafWxYM4ERQOg3C
SJZwiYcG4JGnTSvrqxTZCBgNn4Tc7xc8kduH+xW6nRtjPgIBLkvqIvBto18fLLJO
xxcg4a3MqypWjDjhCfYikYRGi1l3ZOqJFcbNEuX7IPOG0LRmITpbXloagYRKP2mK
N/lYHcNIVW79DYsuJl7h4Tf34BuuExKYu2+q38hqsKn+qVeLg0CGEzwQtsSRfzjB
y1QBETZmPP1Nru5It4r+lP8J4F1aPjZdavNfGKbpOaycRvO4JKOgv6EricAZH0yG
XBYLEA+49bT3dggxTuQaZTkJk2P+av8I+ovTYWiwgAie
=YE1V
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to