[pkg-bacula-commits] [bacula] 01/01: Test config before attempting to start daemons via init scripts (Closes: #825064)
Carsten Leonhardt
leo at moszumanska.debian.org
Sun May 29 13:26:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
leo pushed a commit to branch master
in repository bacula.
commit fb26b97f7ae8a355f3654e21ecd8fdbc80071e33
Author: Carsten Leonhardt <leo at debian.org>
Date: Sun May 29 15:26:05 2016 +0200
Test config before attempting to start daemons via init scripts
(Closes: #825064)
---
debian/bacula-director-common.bacula-director.init | 12 ++++++++----
debian/bacula-fd.init | 10 ++++++++--
debian/bacula-sd.init | 10 ++++++++--
debian/changelog | 7 +++++++
4 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/debian/bacula-director-common.bacula-director.init b/debian/bacula-director-common.bacula-director.init
index 3c8f258..f8884aa 100644
--- a/debian/bacula-director-common.bacula-director.init
+++ b/debian/bacula-director-common.bacula-director.init
@@ -61,14 +61,18 @@ kill_pid()
kill -$1 $2 2>/dev/null || true
}
-# do_start()
do_start()
{
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --oknodo --exec $DAEMON -- -c $CONFIG $ARGS
+ if $DAEMON -t -c $CONFIG $ARGS > /dev/null 2>&1; then
+ start-stop-daemon --start --quiet --pidfile $PIDFILE \
+ --oknodo --exec $DAEMON -- -c $CONFIG $ARGS
+ return 0
+ else
+ log_progress_msg "- the configtest"
+ return 1
+ fi
}
-# do_stop()
do_stop()
{
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
diff --git a/debian/bacula-fd.init b/debian/bacula-fd.init
index 4ccc7d5..8d1afa0 100644
--- a/debian/bacula-fd.init
+++ b/debian/bacula-fd.init
@@ -51,8 +51,14 @@ PIDFILE=/var/run/bacula/$NAME.$PORT.pid
do_start()
{
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --oknodo --exec $DAEMON -- -c $CONFIG $ARGS
+ if $DAEMON -t -c $CONFIG $ARGS > /dev/null 2>&1; then
+ start-stop-daemon --start --quiet --pidfile $PIDFILE \
+ --oknodo --exec $DAEMON -- -c $CONFIG $ARGS
+ return 0
+ else
+ log_progress_msg "- the configtest"
+ return 1
+ fi
}
do_stop()
diff --git a/debian/bacula-sd.init b/debian/bacula-sd.init
index 6fae0ab..d3c4b78 100644
--- a/debian/bacula-sd.init
+++ b/debian/bacula-sd.init
@@ -48,8 +48,14 @@ PIDFILE=/var/run/bacula/$NAME.$PORT.pid
do_start()
{
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --oknodo --exec $DAEMON -- -c $CONFIG $ARGS
+ if $DAEMON -t -c $CONFIG $ARGS > /dev/null 2>&1; then
+ start-stop-daemon --start --quiet --pidfile $PIDFILE \
+ --oknodo --exec $DAEMON -- -c $CONFIG $ARGS
+ return 0
+ else
+ log_progress_msg "- the configtest"
+ return 1
+ fi
}
do_stop()
diff --git a/debian/changelog b/debian/changelog
index 36257e8..e690fe3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+bacula (7.4.0+dfsg-2) unstable; urgency=medium
+
+ * Test config before attempting to start daemons via init scripts
+ (Closes: #825064)
+
+ --
+
bacula (7.4.0+dfsg-1) unstable; urgency=low
* New upstream release
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bacula/bacula.git
More information about the pkg-bacula-commits
mailing list