diff --git a/services/sysvinit-yocto/service-background.template b/services/sysvinit-yocto/service-background.template index f41b83f..c960c41 100644 --- a/services/sysvinit-yocto/service-background.template +++ b/services/sysvinit-yocto/service-background.template @@ -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" diff --git a/services/sysvinit/service-start-stop-daemon.template b/services/sysvinit/service-start-stop-daemon.template index 71a79ec..f579b23 100644 --- a/services/sysvinit/service-start-stop-daemon.template +++ b/services/sysvinit/service-start-stop-daemon.template @@ -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'