summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfelics@felics-tablet2018-01-30 11:53:25 +0100
committerfelics@felics-tablet2018-01-30 11:53:25 +0100
commit1b386813147e25225963de1e6eeb6a594fc65c26 (patch)
tree53b553e2d3b5feb135b2703cab65d28fd0b12ebe
parente99cc5c4e2059a1dba4a6d57403837d58684a268 (diff)
downloadaur-1b386813147e25225963de1e6eeb6a594fc65c26.tar.gz
Changed OpenRC and sysvinit initscripts to report on not-stopped processes, if stopping fails.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rw-r--r--initscript_openrc7
-rw-r--r--initscript_sysvinit18
4 files changed, 24 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6fbe09ed81e7..c34653ef5367 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = wwwoffle-svn
pkgdesc = Simple caching proxy server with special features (request, recursive fetch, subscription, modify HTML, ...) for use with dial-up internet links. Includes startup scripts for OpenRC, System V init, systemd.
pkgver = 2.9j+svn2229
- pkgrel = 3
+ pkgrel = 4
epoch = 1
url = http://www.gedanken.org.uk/software/wwwoffle/
install = wwwoffle.install
diff --git a/PKGBUILD b/PKGBUILD
index c395b257c1e5..68f560a7b659 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,7 @@ pkgname="${_pkgname}-svn"
# _pkgver=2.9i
epoch=1
pkgver=2.9j+svn2229
-pkgrel=3
+pkgrel=4
pkgdesc="Simple caching proxy server with special features (request, recursive fetch, subscription, modify HTML, ...) for use with dial-up internet links. Includes startup scripts for OpenRC, System V init, systemd."
arch=('i686' 'x86_64' 'arm' 'arm64')
url="http://www.gedanken.org.uk/software/wwwoffle/"
diff --git a/initscript_openrc b/initscript_openrc
index 1c5eaeb6dc2e..c1ee48ec9960 100644
--- a/initscript_openrc
+++ b/initscript_openrc
@@ -37,7 +37,12 @@ stop() {
kill -9 "${_pid}" &> /dev/null
done
}
- eend "$?"
+ _running="$(pidof "${_DAEMON}" | tr ' ' '\n' | wc -l)"
+ if [ ${_running} -gt 0 ]; then
+ eerror "Failed to stop or kill all ${_DAEMON} processes."
+ eerror "Remaining processes: ${_running}."
+ fi
+ eend "${_running}"
}
reload() {
diff --git a/initscript_sysvinit b/initscript_sysvinit
index 6f2c124b46de..a1b0781e492e 100644
--- a/initscript_sysvinit
+++ b/initscript_sysvinit
@@ -42,8 +42,22 @@ case "$1" in
;;
stop)
stat_busy "Stopping ${_pretty_name}"
- [ ! -z "$PID" ] && kill $PID &> /dev/null || kill -9 $PID &>/dev/null
- if [ $? -gt 0 ]; then
+ if [ ! -z "${PID}" ]; then
+ kill "${PID}"
+ else
+ _pids="$(pidof "${_DAEMON}")"
+ for _pid in ${_pids}; do
+ kill "${_pid}" &> /dev/null
+ done
+ fi
+ _pids="$(pidof "${_DAEMON}")"
+ for _pid in ${_pids}; do
+ kill -9 "${_pid}" &> /dev/null
+ done
+ _running="$(pidof "${_DAEMON}" | tr ' ' '\n' | wc -l)"
+ if [ ${_running} -gt 0 ]; then
+ echo "Failed to stop or kill all ${_DAEMON} processes."
+ echo "Remaining processes: ${_running}."
stat_fail
else
rm_daemon wwwoffle