Python script start at boot
Posted: Thu Aug 30, 2012 7:41 am
I want to start a python script when rebooting.
What I have is:
--------------------------------------------------------------------------------------------------
cat /etc/init.d/x-files_remote
#!/bin/sh
### BEGIN INIT INFO
# Provides: x-files_remote
# Required-Start: $all
# Required-Stop: $all
# Should-Start: $all
# Should-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start at boot och stop at shutdown
# Description: Start Remote Stick Server
### END INIT INFO
/home/jurka/my_scripts/remote_stick_server # Remote Stick Server
--------------------------------------------------------------------------------------------------
cat /home/jurka/my_scripts/remote_stick_server
#!/bin/sh
cd /home/jurka/remotestick-server
./remotestick-server.py -h 192.168.0.2 > /dev/null 2>&1 &
cd
--------------------------------------------------------------------------------------------------
I have also given sudo update-rc.d -f x-files_remote remove && sudo update-rc.d x-files_remote defaults
After reboot the script /etc/init.d/x-files_remote has not executed but when I give the command /etc/init.d/x-files_remote it works OK
What is wrong ?
What I have is:
--------------------------------------------------------------------------------------------------
cat /etc/init.d/x-files_remote
#!/bin/sh
### BEGIN INIT INFO
# Provides: x-files_remote
# Required-Start: $all
# Required-Stop: $all
# Should-Start: $all
# Should-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start at boot och stop at shutdown
# Description: Start Remote Stick Server
### END INIT INFO
/home/jurka/my_scripts/remote_stick_server # Remote Stick Server
--------------------------------------------------------------------------------------------------
cat /home/jurka/my_scripts/remote_stick_server
#!/bin/sh
cd /home/jurka/remotestick-server
./remotestick-server.py -h 192.168.0.2 > /dev/null 2>&1 &
cd
--------------------------------------------------------------------------------------------------
I have also given sudo update-rc.d -f x-files_remote remove && sudo update-rc.d x-files_remote defaults
After reboot the script /etc/init.d/x-files_remote has not executed but when I give the command /etc/init.d/x-files_remote it works OK
What is wrong ?