good day. I am bad at Freebsd and this issue is difficult for me. I want to start a python script on Freebsd startup but i have trouble accomplishing it. I read lots of guides on it and found i need to write a small script and put it in rc.d folder. I dont know how to write script properly so i copied one on the internet. Maybe the script is bad but it seems the system does not see it at all. So here is my scripts:
So i named this script "radon". First i put it in /usr/local/etc/rc.d and added to etc/r.conf a line "radon_enable="YES""
I also put cmd "chmod +x /usr/local/etc/rc.d/radon"
So after sturtup OS does not start my python script but it said: "not found etc/rc.d/radon". I assumed OS searched my sctript in "etc/rc.d" instead of "/usr/local/etc/rc.d". So i put my file there too and entered "chmod +x /etc/rc.d/radon". But nothing changes, on startup it still says "not found etc/rc.d/radon". I dont see "radon start" output on startup. I know i need to dig some manual deeper but i spend a few days trying to find the issue so i decided to ask for help. Maybe the script is written wrong but must it give some output about it?
My freebsd version is 13.2 release.
Code:
#!/bin/sh
# PROVIDE: radon
. /etc/rc.subr
name="radon"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
radon_start() {
echo "radon starting"
# your commands here
nohup python /python_scripts/old_v.py &
}
radon_stop() {
echo "radon finished"
# your commands here
}
run_rc_command "$1"
# eof
So i named this script "radon". First i put it in /usr/local/etc/rc.d and added to etc/r.conf a line "radon_enable="YES""
I also put cmd "chmod +x /usr/local/etc/rc.d/radon"
So after sturtup OS does not start my python script but it said: "not found etc/rc.d/radon". I assumed OS searched my sctript in "etc/rc.d" instead of "/usr/local/etc/rc.d". So i put my file there too and entered "chmod +x /etc/rc.d/radon". But nothing changes, on startup it still says "not found etc/rc.d/radon". I dont see "radon start" output on startup. I know i need to dig some manual deeper but i spend a few days trying to find the issue so i decided to ask for help. Maybe the script is written wrong but must it give some output about it?
My freebsd version is 13.2 release.