andrum99
Posts: 1239
Joined: Fri Jul 20, 2012 2:41 pm

running a python script at startup on jessie

Sun Dec 06, 2015 10:03 pm

I have a python script that I run when one of my pi's starts up - it logs the ambient temperature to a database, and displays it on a 2 line display. On wheezy I simply inserted a line at the bottom of the /etc/rc.local file. Unfortunately on jessie this does not seem to work - even with the "wait for network" boot option the python script never starts. I'm thinking that perhaps it is time to bite the bullet as they say and create a service for this script all of its own. Can anyone point me to how this is done?

paulv
Posts: 563
Joined: Tue Jan 15, 2013 12:10 pm
Location: Netherlands

Re: running a python script at startup on jessie

Mon Dec 07, 2015 7:03 am

You can find an example in /etc/init.d
You can also look at a post I recently made that has some more comments on how to do it. viewtopic.php?f=37&t=128019&p=856530&hi ... on#p856530
Enjoy!

andrum99
Posts: 1239
Joined: Fri Jul 20, 2012 2:41 pm

Re: running a python script at startup on jessie

Mon Dec 07, 2015 5:27 pm

paulv wrote:You can find an example in /etc/init.d
Ah yes, I was forgetting I could just write a good old init script - thanks!
paulv wrote:You can also look at a post I recently made that has some more comments on how to do it. viewtopic.php?f=37&t=128019&p=856530&hi ... on#p856530
Enjoy!
Thanks - I will have a look.

Return to “Raspberry Pi OS”