diff options
author | felics@felics-tablet | 2018-01-30 11:53:25 +0100 |
---|---|---|
committer | felics@felics-tablet | 2018-01-30 11:53:25 +0100 |
commit | 1b386813147e25225963de1e6eeb6a594fc65c26 (patch) | |
tree | 53b553e2d3b5feb135b2703cab65d28fd0b12ebe | |
parent | e99cc5c4e2059a1dba4a6d57403837d58684a268 (diff) | |
download | aur-1b386813147e25225963de1e6eeb6a594fc65c26.tar.gz |
Changed OpenRC and sysvinit initscripts to report on not-stopped processes, if stopping fails.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | initscript_openrc | 7 | ||||
-rw-r--r-- | initscript_sysvinit | 18 |
4 files changed, 24 insertions, 5 deletions
@@ -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 @@ -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 |