Package: salt
Version: 2015.8.8+ds-1
Severity: minor

I believe I've ran into a small bug in the Debian 7 init.d script. I'm
currently working on a feature for the salt-bootstrap project to enable
installing salt into a virtualenv on Debian (
https://github.com/l2ol33rt/salt-bootstrap/tree/debian_venv_support). This
moves the daemon binary to a location other than the default:
/usr/bin/salt-<daemon>. I've attempted to leverage the
/etc/default/salt-<daemon> file to point to the new binary location. For
example, the file /etc/default/salt-master would contain:
DAEMON=/usr/lib/virtualenv/salt/bin/salt-master

The salt-bootstrap script pulls directly from the debian git repository (
http://anonscm.debian.org/cgit/pkg-salt/salt.git/) for its init.d scripts
since they are not bundled with the salt project itself. However, the
init.d scripts test for the daemon binary's existence right before the
loading of /etc/default/salt-<daemon> which then fails causing the service
to exit immediately.

Attached is my patch for the 4 salt init.d scripts, I hope this would be
something worth including into the salt debian repo.

System Versions:
         dist: debian 7.10
        machine: x86_64
        release: 3.2.0-4-amd64
         system: Linux
        version: debian 7.10

Thanks for your time,

~Rob
https://github.com/l2ol33rt
From bd0fffa6050fead2559610ceb318f8610f518fe6 Mon Sep 17 00:00:00 2001
From: Robert James Hernandez <l2ol3...@gmail.com>
Date: Fri, 6 May 2016 10:13:00 -0700
Subject: [PATCH] Moving daemon check to after loading default

---
 debian/salt-api.init    | 6 +++---
 debian/salt-master.init | 6 +++---
 debian/salt-minion.init | 6 +++---
 debian/salt-syndic.init | 6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/debian/salt-api.init b/debian/salt-api.init
index be719b8..be398cd 100644
--- a/debian/salt-api.init
+++ b/debian/salt-api.init
@@ -19,12 +19,12 @@ DAEMON_ARGS="-d"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
 # Read configuration variable file if it is present
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
 . /lib/init/vars.sh
 . /lib/lsb/init-functions
 
diff --git a/debian/salt-master.init b/debian/salt-master.init
index b92ba30..6643a25 100644
--- a/debian/salt-master.init
+++ b/debian/salt-master.init
@@ -19,12 +19,12 @@ DAEMON_ARGS="-d"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
 # Read configuration variable file if it is present
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
 . /lib/lsb/init-functions
 
 do_start() {
diff --git a/debian/salt-minion.init b/debian/salt-minion.init
index 4384747..d22fdc0 100644
--- a/debian/salt-minion.init
+++ b/debian/salt-minion.init
@@ -19,12 +19,12 @@ DAEMON_ARGS="-d"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
 # Read configuration variable file if it is present
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
 . /lib/lsb/init-functions
 
 do_start() {
diff --git a/debian/salt-syndic.init b/debian/salt-syndic.init
index 6142522..d824b54 100644
--- a/debian/salt-syndic.init
+++ b/debian/salt-syndic.init
@@ -19,12 +19,12 @@ DAEMON_ARGS="-d"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
 # Read configuration variable file if it is present
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
 . /lib/lsb/init-functions
 
 do_start() {
-- 
1.9.1

Reply via email to