Crannog
Posts: 8
Joined: Wed Jun 29, 2016 11:00 pm

Automatic respawn of a init script

Tue Sep 27, 2016 7:41 am

Hi,

Forgive me if I'm missing something obvious. I've built a remote solar powered weatherstation. It runs Python script at startup using a Start-Stop-Damon as described here :http://blog.scphillips.com/posts/2013/0 ... e-on-boot/

I've installed the service as described using "sudo update-rc.d" and it works great. However it crashes occasionally if it can't make a network connection. I currently use a CRON task to restart the service every 2 hours to manage this. (in event of a crash it will re-start in <2hrs). Ideally I'd like it to automatically start if it crashed.

Is it possible to so this with a init.d script?

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Automatic respawn of a init script

Tue Sep 27, 2016 7:47 am

use systemd not init scripts
dougie will be along RSN with an example .... unless I can find it before hand


[edit]
this may help
viewtopic.php?f=63&t=138861
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Crannog
Posts: 8
Joined: Wed Jun 29, 2016 11:00 pm

Re: Automatic respawn of a init script

Tue Sep 27, 2016 9:36 pm

Great thanks, I'll give it a try. :D

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Automatic respawn of a init script

Tue Sep 27, 2016 11:14 pm

RaTTuS wrote: [edit]
this may help
viewtopic.php?f=63&t=138861
That's the one I'm using as a good example from Heater.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Crannog
Posts: 8
Joined: Wed Jun 29, 2016 11:00 pm

Re: Automatic respawn of a init script

Sat Oct 01, 2016 8:05 am

Many thanks, all working great. Self recovered great from a power glitch and a Pi Zero crash.

Return to “Beginners”