Page 1 of 1

Python script start at boot

Posted: Thu Aug 30, 2012 7:41 am
by zkab
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 ?

Re: Python script start at boot

Posted: Thu Aug 30, 2012 7:45 pm
by Jamesc359
Have you tried running update-rc.d x-files_remote defaults ?

Re: Python script start at boot

Posted: Fri Aug 31, 2012 4:21 am
by zkab
I did as you can see from my post above ...
zkab wrote: I have also given sudo update-rc.d -f x-files_remote remove && sudo update-rc.d x-files_remote defaults

Re: Python script start at boot

Posted: Tue Sep 04, 2012 5:14 pm
by Jamesc359
Have you tried sending the output of emotestick-server.py to a file? Could it be that it's running before a necessary service is being provided?

Re: Python script start at boot

Posted: Wed Sep 05, 2012 7:09 am
by zkab
Jamesc359 wrote:Could it be that it's running before a necessary service is being provided?
I suspect that is the problem ... will look into that