Hello all,
I have an application I developed for internal use that runs in the foreground. After looking through the handbook I thought I got a handle on how to create the rc script (seen below):
The issue I'm running in to is when I want to stop the service (for example, to upgrade the released application) it complains with the following message:
When I
Checking permissions of the pidfile indicates that it has the
Does anyone see an issue with my rc script? I've been checking through the documentation and it seems like it should be relatively straightforward but obviously I have something messed up here.
Thanks for any assistance!
I have an application I developed for internal use that runs in the foreground. After looking through the handbook I thought I got a handle on how to create the rc script (seen below):
Code:
#!/bin/sh
# PROVIDE: platform-worker
# REQUIRE: LOGIN NETWORKING netif named
# KEYWORD: shutdown
. /etc/rc.subr
name="platform-worker"
rcvar="platform_worker_enable"
required_dirs="/home/mylanc/platform"
logfile="/var/log/platform-worker.log"
pidfile="/var/run/${name}.pid"
load_rc_config "$name"
: ${platform_worker_enable:="NO"}
: ${platform_worker_user:="mylanc"}
: ${platform_worker_group:="mylanc"}
: ${platform_worker_config:="/home/mylanc/.platform.toml"}
command="/home/mylanc/platform/platform --config ${platform_worker_config} worker"
start_cmd="/usr/sbin/daemon -P ${pidfile} -r -u ${platform_worker_user} ${command} >> ${logfile} 2>&1"
run_rc_command "$1"
The issue I'm running in to is when I want to stop the service (for example, to upgrade the released application) it complains with the following message:
Code:
platform-worker not running? (check /var/run/platform-worker.pid).
When I
cat
the file in question as root, I can see a pid that matches a daemon process:
Code:
# cat /var/run/platform-worker.pid
63991
# ps ax | grep 63991
63991 - Is 0:00.00 daemon: /home/mylanc/platform/platform[67545] (daemon)
10064 0 S+ 0:00.00 grep --color=auto 63991
Checking permissions of the pidfile indicates that it has the
rw
permission for root only (no extra permissions set).Does anyone see an issue with my rc script? I've been checking through the documentation and it seems like it should be relatively straightforward but obviously I have something messed up here.
Thanks for any assistance!