Hello there!
I’ve been trying to run two scripts when my plex jail starts up. TrueNas CORE, the jail is running 13.3-RELEASE-p1.
This is the first script:
/usr/local/etc/rc.d/run_rclone
#!/bin/sh
. /etc/rc.subr
name=run_rclone
rcvar=run_rclone_enable
load_rc_config $name
command=/usr/sbin/daemon
start_precmd=rclone_precmd
rclone_precmd()
{
cd /home/
/usr/local/bin/rclone mount rd:torrents /home/rd --umask 000 --dir-cache-time 10s --allow-other --allow-non-empty --vfs-cache-mode full --debug-fuse
}
run_rc_command "$1"
and my second one
/usr/local/etc/rc.d/run_plex_debrit
#!/bin/sh
. /etc/rc.subr
name=run_plex_debrid
rcvar=run_plex_debrid_enable
load_rc_config $name
command=/usr/sbin/daemon
start_precmd=debrid_precmd
debrid_precmd()
{
cd /home/plex_debrid
/usr/local/bin/python ./main.py
}
run_rc_command "$1"
They are both added to the jail’s rc.conf (/etc/rc.conf
).
Here are its contents:
cron_flags="$cron_flags -J 15"
# Disable Sendmail by default
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
# Run secure syslog
syslogd_flags="-c -ss"
# Enable IPv6
ipv6_activate_all_interfaces="YES"
plexmediaserver_enable="YES"
run_plex_debrit_enable="yes"
run_rclone_enable="yes"
I can run both using service ... start
from inside the jail and they work, but I can’t get them to run on startup.
What am I missing? I’ve been trying to figure this out for the past 6-7 hours. Any guidance is welcome!