Trying to run a python script on boot-up of CentOS. My /etc/init.d/example-script looks like this:
case $1 in
start)
$(python /etc/bin/example-script.py &)
;;
stop)
echo "filler text"
;;
When I try service example-script start, it runs the script, but does not execute in the background. example-script.py has a while(True) loop, so maybe this is why?
But when I type python /etc/bin/example-script.py & in Terminal, it does execute in the background. It's only when this command is inside a bash script that it fails.