[packages/ulogd] Rel 5; use pidfiles in init script
arekm
arekm at pld-linux.org
Thu Dec 16 07:54:21 CET 2021
commit 3a124ecddd14e1ae09b96c3a11ce9bd20a7cb9ff
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Dec 16 07:53:30 2021 +0100
Rel 5; use pidfiles in init script
ulogd.init | 23 ++++++++++++++++-------
ulogd.spec | 2 +-
2 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/ulogd.spec b/ulogd.spec
index 3b6984f..cec82ee 100644
--- a/ulogd.spec
+++ b/ulogd.spec
@@ -2,7 +2,7 @@ Summary: ULOGD - the Userspace Logging Daemon for iptables
Summary(pl.UTF-8): Demon logujący w trybie użytkownika dla iptables
Name: ulogd
Version: 2.0.7
-Release: 4
+Release: 5
License: GPL v2+
Group: Networking/Daemons
Source0: https://netfilter.org/projects/ulogd/files/%{name}-%{version}.tar.bz2
diff --git a/ulogd.init b/ulogd.init
index e2a4d46..128cc9b 100644
--- a/ulogd.init
+++ b/ulogd.init
@@ -29,9 +29,10 @@ case "$1" in
bname=$(basename $i .conf)
if [ ! -f /var/lock/subsys/ulogd-$bname ]; then
msg_starting ulogd-$bname
- daemon ulogd -d -c $i
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ulogd-$bname
+ daemon ulogd -d -p /var/run/ulogd-$bname.pid -c $i
+ RETVAL_LOCAL=$?
+ RETVAL=$(($RETVAL+$RETVAL_LOCAL))
+ [ $RETVAL_LOCAL -eq 0 ] && touch /var/lock/subsys/ulogd-$bname
else
msg_already_running ulogd-$bname
fi
@@ -40,15 +41,23 @@ case "$1" in
;;
stop)
if [ -f /var/lock/subsys/ulogd ]; then
- msg_stopping ulogd
- killproc ulogd
- rm -f /var/lock/subsys/ulogd* >/dev/null 2>&1
+ for i in $CONFIGS; do
+ bname=$(basename $i .conf)
+ msg_stopping ulogd-$bname
+ killproc -p /var/run/ulogd-$bname.pid ulogd
+ RETVAL=$(($RETVAL+$?))
+ rm -f /var/lock/subsys/ulogd-$bname 2>&1
+ done
+ rm -f /var/lock/subsys/ulogd >/dev/null 2>&1
else
msg_not_running ulogd
fi
;;
status)
- status ulogd
+ for i in $CONFIGS; do
+ bname=$(basename $i .conf)
+ status -p /var/run/ulogd-$bname.pid ulogd-$bname ulogd
+ done
exit $?
;;
reload)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ulogd.git/commitdiff/3a124ecddd14e1ae09b96c3a11ce9bd20a7cb9ff
More information about the pld-cvs-commit
mailing list