[pkg-bacula-commits] [bacula] 04/05: Implemented try-restart in init scripts
Carsten Leonhardt
leo at moszumanska.debian.org
Tue Aug 15 16:26:17 UTC 2017
This is an automated email from the git hooks/post-receive script.
leo pushed a commit to branch master
in repository bacula.
commit e82fe29e81908c7a7aab2eb9f1d087a3865d9841
Author: Carsten Leonhardt <leo at debian.org>
Date: Tue Aug 15 17:25:40 2017 +0200
Implemented try-restart in init scripts
---
debian/TODO | 4 ----
debian/bacula-director.init | 22 ++++++++++------------
debian/bacula-fd.init | 7 +++++--
debian/bacula-sd.init | 7 +++++--
debian/changelog | 1 +
5 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/debian/TODO b/debian/TODO
index f8430fc..a663144 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -29,10 +29,6 @@ Normal:
check dh-sysuser
https://lists.debian.org/debian-devel/2016/10/msg00665.html
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=621833
- * Policy 9.3.2:
- New optional try-restart standard init script argument, which (if
- supported) should restart the service if it is already running and
- otherwise just report success.
Minor:
diff --git a/debian/bacula-director.init b/debian/bacula-director.init
index 8ac7c36..e041973 100644
--- a/debian/bacula-director.init
+++ b/debian/bacula-director.init
@@ -97,8 +97,7 @@ case "$1" in
else
log_end_msg 1
fi
- ;;
-
+ ;;
stop)
log_daemon_msg "Stopping $DESC..." "$NAME"
if do_stop ; then
@@ -106,29 +105,28 @@ case "$1" in
else
log_end_msg 1
fi
- ;;
-
+ ;;
reload)
log_daemon_msg "Reloading $DESC..." "$NAME"
get_pid $PIDFILE
if [ -n "$pid" ]; then kill_pid HUP $pid ;
else do_start ;
fi
- ;;
-
+ ;;
restart|force-reload)
$0 stop
$0 start
- ;;
-
+ ;;
+ try-restart)
+ $0 status || exit 0
+ $0 restart
+ ;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME
- ;;
-
+ ;;
*)
N=/etc/init.d/$NAME
- # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
- echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
+ echo "Usage: $N {start|stop|reload|restart|force-reload|try-restart|status}" >&2
exit 1
;;
esac
diff --git a/debian/bacula-fd.init b/debian/bacula-fd.init
index 649b9cc..6a26191 100644
--- a/debian/bacula-fd.init
+++ b/debian/bacula-fd.init
@@ -90,18 +90,21 @@ case "$1" in
log_end_msg 1
fi
;;
-
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
+ try-restart)
+ $0 status || exit 0
+ $0 restart
+ ;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME
;;
*)
N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+ echo "Usage: $N {start|stop|restart|force-reload|try-restart|status}" >&2
exit 1
;;
esac
diff --git a/debian/bacula-sd.init b/debian/bacula-sd.init
index 47c3d07..73a8663 100644
--- a/debian/bacula-sd.init
+++ b/debian/bacula-sd.init
@@ -89,18 +89,21 @@ case "$1" in
log_end_msg 1
fi
;;
-
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
+ try-restart)
+ $0 status || exit 0
+ $0 restart
+ ;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME
;;
*)
N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+ echo "Usage: $N {start|stop|restart|force-reload|try-restart|status}" >&2
exit 1
;;
esac
diff --git a/debian/changelog b/debian/changelog
index b62b568..fe570fb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,7 @@ bacula (9.0.3+dfsg-1) unstable; urgency=low
* debian/NEWS: Warn that sqlite3 is no longer officially supported, also
warn that we no longer support the make_catalog_backup_awk scripts and
that they will be removed after the next debian release
+ * Implemented try-restart in init scripts
--
--
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