[Debian-ha-commits] [csync2] 01/01: Cleanup postinst and prerm
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Thu Jul 14 07:16:12 UTC 2016
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch master
in repository csync2.
commit 0c7b75191572c279e8436a64833679335c0cee46
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date: Tue Jul 5 20:50:23 2016 +0200
Cleanup postinst and prerm
Check if update-inetd exists before calling it.
---
debian/postinst | 14 +++++++-------
debian/prerm | 21 ++++++++++++++-------
2 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/debian/postinst b/debian/postinst
index e0a4c8c..9242be1 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -19,13 +19,13 @@ set -e
case "$1" in
configure)
-
- if ! grep -q -s "^csync2" /etc/inetd.conf ; then
- update-inetd --remove '^csync2'
- update-inetd --group OTHER --add \
- 'csync2\t\tstream\ttcp\tnowait\troot\t/usr/sbin/csync2\tcsync2 -i -l'
- fi
-
+ if test -x /usr/sbin/update-inetd && \
+ ! grep -q -s "^csync2" /etc/inetd.conf
+ then
+ update-inetd --remove '^csync2'
+ update-inetd --group OTHER --add \
+ 'csync2\t\tstream\ttcp\tnowait\troot\t/usr/sbin/csync2\tcsync2 -i -l'
+ fi
;;
diff --git a/debian/prerm b/debian/prerm
index 17f1726..2902e3d 100644
--- a/debian/prerm
+++ b/debian/prerm
@@ -15,18 +15,25 @@ set -e
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
-
+#
case "$1" in
remove|upgrade|deconfigure)
+ if test -x /usr/sbin/update-inetd
+ then
+ update-inetd --remove '^csync2'
+
+ if [ -f /var/run/inetd.pid ] ; then
+ kill -s HUP $(cat /var/run/inetd.pid)
+ fi
+ fi
+
+ ;;
- update-inetd --remove '^csync2'
- if [ -f /var/run/inetd.pid ] ; then
- kill -s HUP $(cat /var/run/inetd.pid)
- fi
- ;;
failed-upgrade)
- ;;
+
+ ;;
+
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/csync2.git
More information about the Debian-HA-Commits
mailing list