I'm trying to setup a startup script to run two lines I currently do manually inside the jail
I looked at a few resources, namely
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/rcng-daemon-adv.html
https://forums.freenas.org/index.php?threads/run-command-at-iocage-jail-startup.61819/
And saw 2 formatting styles, tried both - looking like so:
attempt #1
#attempt 2
And then:
Either way, it errors with
Is the syntax I'm getting wrong or something else entirely?
source ~/py3-venv-pgadmin/bin/activate.csh
python3 ~/py3-venv-pgadmin/lib/python3.6/site-packages/pgadmin4/pgAdmin4.py &
I looked at a few resources, namely
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/rcng-daemon-adv.html
https://forums.freenas.org/index.php?threads/run-command-at-iocage-jail-startup.61819/
And saw 2 formatting styles, tried both - looking like so:
attempt #1
Code:
#!/bin/sh # # # . /etc/rc.subr name="pgadmin4-daemon" rcvar="${name}_enable" load_rc_config ${name} pidfile="/var/run/pgadmin4-daemon.pid" command="source ~/py3-venv-pgadmin/bin/activate.csh" command_args="python3 ~/py3-venv-pgadmin/lib/python3.6/site-packages/pgadmin4/pgAdmin4.py &" run_rc_command "$1"
#attempt 2
Code:
#!/bin/sh # # . /etc/rc.subr name="pgadmin4-daemon" rcvar="${name}_enable" start_cmd="${name}_start" stop_cmd=":" load_rc_config $name pgadmin4-daemon_start() { source ~/py3-venv-pgadmin/bin/activate.csh python3 ~/py3-venv-pgadmin/lib/python3.6/site-packages/pgadmin4/pgAdmin4.py & } run_rc_command "$1"
And then:
echo 'pgadmin4-daemon_enable="YES"' >> /etc/rc.conf
chmod +x /etc/rc.d/pgadmin4-daemon
Either way, it errors with
Code:
service pgadmin4-daemon start /etc/rc.conf: pgadmin4-daemon_enable=YES: not found /etc/rc.conf: pgadmin4-daemon_enable=YES: not found /etc/rc.d/pgadmin4-daemon: WARNING: $pgadmin4-daemon_enable is not set properly - see rc.conf(5). Cannot 'start' pgadmin4-daemon. Set pgadmin4-daemon_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.
Is the syntax I'm getting wrong or something else entirely?