Skip to content

Commit

Permalink
Merge pull request #51 from thin-edge/fix-sysvinit-lock-location
Browse files Browse the repository at this point in the history
fix(sysvinit): improve pidfile location fallback
  • Loading branch information
reubenmiller authored Nov 2, 2024
2 parents 93a90d6 + e085c41 commit 3f4046a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions services/sysvinit-yocto/service-background.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ DAEMON_ARGS="$COMMAND_ARGS"

name="$NAME"
PIDFILE=/run/lock/$name.lock
if [ -d /run/lock ]; then
PIDFILE=/run/lock/$name.lock
else
PIDFILE=/var/run/$name.lock
fi
stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err"

Expand Down
5 changes: 5 additions & 0 deletions services/sysvinit/service-start-stop-daemon.template
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export TEDGE_RUN_LOCK_FILES="false"

DAEMON=$COMMAND
PIDFILE=/run/lock/$NAME.lock
if [ -d /run/lock ]; then
PIDFILE=/run/lock/$NAME.lock
else
PIDFILE=/var/run/$NAME.lock
fi

STOP_RETRY_SCHEDULE='TERM/30/KILL/1'

Expand Down

0 comments on commit 3f4046a

Please sign in to comment.