3

I have a little python3 script to control our central heating. It runs through a while true: loop, with time.sleep(-time.time() % 5) to be synchronized to the system clock while checking the if statements forever. Total runtime is over one year. It runs inside GNU screen on Arch Linux ARM on a Raspberry 2.

Until now, it happened twice, that the program just "sleeps" until I log in and reattach to the screen. Then I can see the output e.g. from five hours ago when it started to sleep and as soon as getting reattached to the screen, it continues to work again and give new output.

I have no idea where to start since I get no errors and the "sleeps" happened to happen without any relation I could think of.

And I have two other python scripts also running on its own GNU screen. One script still recorded temperatures to a database with a time.sleep(-time.time() % 60) and the other still saved values to a database all the time.

Timon
  • 31
  • 2
  • Any luck fixing this? I have a very similar issue running a Python job with screen over SSH. – Brenden Petersen Aug 07 '19 at 16:56
  • @BrendenPetersen unfortunately no and recently it hit me again. What about you, did you find out why it happens? – Timon Oct 25 '19 at 13:01
  • Nope. I found someone with a similar issue but again no explanation or solution. Curious, when attached to the screen do you sometimes enable scrolling using the prefix (`Ctrl` + `a`) + `Escape` command? – Brenden Petersen Oct 25 '19 at 17:15
  • Is it possible the scheduler sees the user that owns the processes hasn't been logged in in a while, and stops scheduling those processes? (I have no idea, but it seems plausible to me) If so, launching the process using something like init.d or cron will use a system user id (either root or a user created for cron, etc..) that may skip this activity check. – Aaron Feb 13 '20 at 21:32
  • @BrendenPetersen Yes I was using scrolling and noticed delays sometimes when I canceled scrolling. I believe that it has something to do with screen. Since the last update, it did not happen to occur again. What about you? – Timon May 02 '20 at 06:35
  • @Aaron I think it should be a common and known problem if there was such a behavior. I believe it has something to do with screen. – Timon May 02 '20 at 06:38
  • @Timon I have just avoided using the scrolling and haven’t had any issues since. – Brenden Petersen May 02 '20 at 14:52

0 Answers0