Skip to content

Commit

Permalink
app-admin/diamond: (stable) revbump for init.d fix
Browse files Browse the repository at this point in the history
Ensure a missing pid-file doesn't result in more killing than healthy.

Package-Manager: Portage-3.0.9, Repoman-3.0.2
RepoMan-Options: --force
Signed-off-by: Fabian Groffen <[email protected]>
  • Loading branch information
grobian committed Dec 5, 2020
1 parent 78f8b94 commit 49a881a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app-admin/diamond/files/diamond.initd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ stop() {
ebegin "Stopping ${SVCNAME}"
#start-stop-daemon --stop -R 80 --pidfile /run/${SVCNAME}.pid
# diamond doesn't kill its children, so work around that for now
pstree -Tp `cat /run/${SVCNAME}.pid` | grep -o '([0-9]\+)' | tr '()' ' ' | xargs kill
pid=$(< /run/${SVCNAME}.pid)
if [ -n ${pid} ] && [ ${pid} -gt 1 ] ; then
pstree -Tp ${pid} | grep -o '([0-9]\+)' | tr '()' ' ' | xargs kill
fi
eend $?
}

0 comments on commit 49a881a

Please sign in to comment.