Python script start at boot

Forum rules
Before you post please read this

Python script start at boot

Postby zkab on 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 ?
Last edited by xenopeek on Thu Aug 30, 2012 8:02 am, edited 1 time in total.
Reason: As this is about scripting, moving it here.
zkab
Level 2
Level 2
 
Posts: 79
Joined: Wed Jun 22, 2011 7:46 pm

Linux Mint is funded by ads and donations.
 

Re: Python script start at boot

Postby Jamesc359 on Thu Aug 30, 2012 7:45 pm

Have you tried running update-rc.d x-files_remote defaults ?
“Gosh, you've... really got some nice toys here.”
User avatar
Jamesc359
Level 3
Level 3
 
Posts: 116
Joined: Sun May 06, 2012 1:42 pm

Re: Python script start at boot

Postby zkab on Fri Aug 31, 2012 4:21 am

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
zkab
Level 2
Level 2
 
Posts: 79
Joined: Wed Jun 22, 2011 7:46 pm

Re: Python script start at boot

Postby Jamesc359 on Tue Sep 04, 2012 5:14 pm

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?
“Gosh, you've... really got some nice toys here.”
User avatar
Jamesc359
Level 3
Level 3
 
Posts: 116
Joined: Sun May 06, 2012 1:42 pm

Re: Python script start at boot

Postby zkab on Wed Sep 05, 2012 7:09 am

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
zkab
Level 2
Level 2
 
Posts: 79
Joined: Wed Jun 22, 2011 7:46 pm


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest