Go to advanced search

by Rhadamanthys
Thu Nov 30, 2017 8:57 pm
Forum: General discussion
Topic: Re: Scripts dying every night at 0:00-01:00'ish
Replies: 51
Views: 3011

Re: Scripts dying every night at 0:00-01:00'ish

Guess you overcomplicate things. I run a script which includes a statement like this: urlopen(homematic+str(round(avg,0)),timeout=5) NO ERROR HANDLING included!!! supervisor uses this configuration file (/etc/supervisor/superisord.conf), generated at supervisor installation ; supervisor config file ...
by Rhadamanthys
Wed Nov 29, 2017 11:41 am
Forum: General discussion
Topic: Re: Scripts dying every night at 0:00-01:00'ish
Replies: 51
Views: 3011

Re: Scripts dying every night at 0:00-01:00'ish

Glad to hear it's indeed the missing internet accessibility that causes your script to die. But why do you want to handle possible errors and write your own error messages? Did you have a look at my simple script that produces unhandled divide by zero errors frome time to time? Supervisor starts it ...
by Rhadamanthys
Fri Nov 24, 2017 9:01 pm
Forum: General discussion
Topic: Re: Scripts dying every night at 0:00-01:00'ish
Replies: 51
Views: 3011

Re: Scripts dying every night at 0:00-01:00'ish

how do I return a value from a python script Linux executables return a code when they exit. Does this answer your question? Based on this code supervisor decides what to depending on the configuration. Unless specified otherwise supervisor restarts your script only if it exits with an error code. ...
by Rhadamanthys
Fri Nov 24, 2017 4:29 pm
Forum: General discussion
Topic: Re: Scripts dying every night at 0:00-01:00'ish
Replies: 51
Views: 3011

Re: Scripts dying every night at 0:00-01:00'ish

Look at my learning curve!
One line is supervisor's conf file and you know what hickups your script. See screenshot.
supervisor staus reponses:
EXITED: a script sleeping for 10s
FATAL: divzero.py without logfile
BACKUP: same with
by Rhadamanthys
Fri Nov 24, 2017 3:35 pm
Forum: General discussion
Topic: Re: Scripts dying every night at 0:00-01:00'ish
Replies: 51
Views: 3011

Re: Scripts dying every night at 0:00-01:00'ish

1st, let me thank you for drawing my attention to supervisor. There is no need to stay awake to follow my proposals. Assuming the issue is lack of internet access, I'm proposing to pull the dsl line. Can be done in seconds any time of day. Unless specified otherwise, supervisor expects a started pro...
by Rhadamanthys
Thu Nov 23, 2017 5:51 pm
Forum: General discussion
Topic: Re: Scripts dying every night at 0:00-01:00'ish
Replies: 51
Views: 3011

Re: Scripts dying every night at 0:00-01:00'ish

Just learned a bit about supervisor.
For debugging, what prevents you from running your script in the Python shell?
Gives you error messages right away without any overhead code for error logging
by Rhadamanthys
Thu Nov 23, 2017 5:27 pm
Forum: General discussion
Topic: Re: Scripts dying every night at 0:00-01:00'ish
Replies: 51
Views: 3011

Re: Scripts dying every night at 0:00-01:00'ish

Your scripts die every midnight on 2 RPis, your router restarts every midnight but you are pretty confident there's no correlation... Rather than waiting another night to see if the issue moves with restart, what about simply pulling the dsl cable off the router to see how the scripts like the missi...
by Rhadamanthys
Thu Nov 23, 2017 12:53 pm
Forum: General discussion
Topic: Re: Scripts dying every night at 0:00-01:00'ish
Replies: 51
Views: 3011

Re: Scripts dying every night at 0:00-01:00'ish

Just an idea: What if your internet provider restarts your connection every night? Or your router is commissioned to do so? Suggest you set your router to deny internet to your pi and see how your script performs Comment: You also may want to condense the line: timeC = time.strftime("%Y") + "/" + ti...
by Rhadamanthys
Wed Nov 22, 2017 6:21 pm
Forum: General discussion
Topic: Re: Scripts dying every night at 0:00-01:00'ish
Replies: 51
Views: 3011

Re: Scripts saying every night at 0:00-01:00'ish

As a former development engineer I was used to hear my programmer blaming the hardware if something went unexpectedly. Usualy we found the software bug after days of testing the hardware. Here's a trivial code snippet that will raise a divide by zero error the first second of the day: import time, d...

Go to advanced search