Package: influxdb
Version: 1.6.4-1
Severity: normal
Tags: patch

Hi!

The init script's restart action always returns an error code, because
the errcode variable is only assigned on errors from the status
action, and the log_end_msg function will default to an error value if
non is passed to it.

Attached patch should fix this.

Thanks,
Guillem
From 5aa9e83baf01384ddd5a5d10ef3ab29d67360dc9 Mon Sep 17 00:00:00 2001
From: Guillem Jover <gjo...@sipwise.com>
Date: Tue, 19 Feb 2019 15:17:52 +0100
Subject: [PATCH] debian: Fix init script return code on restart action

The errcode is only assigned conditionally when there's an error return
code from the status action. But log_end_msg will default to an error
code of 1 if it gets no argument passed. So in this case the restart
will always return an error code.
---
 debian/influxdb.init | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/influxdb.init b/debian/influxdb.init
index 7e1600d..322dca8 100644
--- a/debian/influxdb.init
+++ b/debian/influxdb.init
@@ -115,8 +115,8 @@ case $1 in
         log_daemon_msg "Restarting $desc" "$name"
         # Restart the daemon.
         $0 stop && sleep 2 && $0 start
-        $0 status || errcode=$?
-        log_end_msg $errcode
+        $0 status
+        log_end_msg $?
         ;;
 
     status)
-- 
2.21.0.rc0.258.g878e2cd30e

Reply via email to