I have created a service from a Python 3 virtual environment that works fine when called (start, stop, restart, status) from the terminal, also when the user is root. But although it's active for boot (shows up in service -e) it does not get started on boot.
I tried to get it started later in the sequence using the REQUIRE option in the rc.d script with some more dependencies, but that didn't help.
Of course I added tcv_enable="YES" to the rc.conf.
Here is my rc.d script:
I'm at the end of my wits... Any suggestions are greatly appreciated!
I tried to get it started later in the sequence using the REQUIRE option in the rc.d script with some more dependencies, but that didn't help.
Of course I added tcv_enable="YES" to the rc.conf.
Here is my rc.d script:
Bash:
#!/bin/sh
# PROVIDE: myapp
# REQUIRE: DAEMON
. /etc/rc.subr
instancename="myapp"
name="myapp"
instancepath="/my/path/to/zope-instances/${instancename}"
rcvar="${name}_enable"
zope="/my/path/to/Zope"
#procname needed for stopping daemon
procname="${zope}/bin/python"
pidfile="/var/run/instances/${instancename}.pid"
zope_ini="${instancepath}/etc/zope.ini"
. /path/to/my/own/functions/myrc.subr
command="${zope}/bin/runwsgi"
# daemon needs user if not called as myuser
daemon_argument=""
if ! [ `whoami` = "myuser" ]; then
daemon_argument='-u myuser'
fi
start_cmd="/usr/sbin/daemon $daemon_argument $command ${zope_ini}"
load_rc_config "$name"
run_rc_command $*
I'm at the end of my wits... Any suggestions are greatly appreciated!