Skip to content

Commit

Permalink
fix granian stop
Browse files Browse the repository at this point in the history
pidfile is missng an `\n`, maybe the read -a var <$pidfile fails due to
this.

whatever ||: mitigates that.
  • Loading branch information
wwwutz committed May 22, 2025
1 parent 294e1cc commit 90e5d04
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions startstop.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ set -x
srv_granian_stop() {
if [[ -s "${DEVSHM}/granian.pid" ]]; then
local pid
read -a pid < "${DEVSHM}/granian.pid"
# ||: since maybe due to missing \n we get some kind of pipefail ?
read -a pid < "${DEVSHM}/granian.pid" ||:
kill -- \${pid}
echo "waiting for process \${pid} to die"
tail -f --pid=\${pid} /dev/null
Expand All @@ -114,15 +115,15 @@ srv_granian_stop() {
fi
if [[ -s "\${PGIDFILE}" ]]; then
local pgid
read -a pgid < "\${PGIDFILE}"
read -a pgid < "\${PGIDFILE}" ||:
echo "killing process group \${pgid}"
kill -- -\${pgid}
echo "waiting for process group \${pgid} to die"
pwait --echo --pgroup \${pgid}
else
if [[ -s "\${PIDFILE}" ]]; then
local pid
read -a pid < "\${PIDFILE}"
read -a pid < "\${PIDFILE}" ||:
kill -- \${pid}
echo "waiting for process \${pid} to die"
tail -f --pid=\${pid} /dev/null
Expand Down

0 comments on commit 90e5d04

Please sign in to comment.