Closed AndyM48 closed 3 months ago
These log lines are from the code: https://github.com/yo8192/fcron/blob/87e8f9536e618b1f8011b7b6e65661b4283296b4/database.c#L1576-L1589.
Less clear as the log lines get truncated... we should probably split these log lines to avoid (or limit) the truncation.
So what happens is fcron reads the (binary) fcrontab, and in there it says the next time the line/job should be run is in the past (after correcting for the sleep duration). In that case fcron takes a conservative view, doesn't run them immediately, but resets when they will be executed next.
This problem could happen if fcron failed to save the (binary) fcrontab when stopping, so it ended up loading an older version. Note that fcron also saves this every --savetime
seconds, by default 1800 (half an hour).
To troubleshoot this, you could:
.orig
are the text form, the other ones are the binary form with the state (including the time and date of next execution). for instance:
$ sudo ls -l /usr/local/var/spool/fcron
-rw------- 1 root root 303 May 29 17:51 root
-rw------- 1 root fcron 118 Apr 3 2023 root.orig
-rw------- 1 root root 721 May 29 17:51 systab
-rw------- 1 root fcron 397 May 29 2023 systab.orig
As for fcron no longer responding, that is odd... do you mean it wasn't running jobs anymore, or was there another symptom?
To troubleshoot, if possible, run fcron in debug mode and capture debug logs.
If and when it happens again, I'd suggest:
sudo fcrondyn -x ls
to see when each job will be executed, and share the outputps
that fcron is still running.
top
it's not spinning and using 100% of one CPU core. If possible, take a core dump of the running process with gcore <pid>
.That all makes sense.
I still don't understand the lines like:
suspend/hibernate detected: we woke up after 33s instead of 60s. The system was suspended for 7s.
here is another one
suspend/hibernate detected: we woke up after 3352s instead of 900s. The system was suspended for 2450s.
As for fcron no longer responding, that is odd... do you mean it wasn't running jobs anymore, or was there another symptom?
Fcron showed a running process, fcrondyn said it could not find the socket after 10 secs (from memory), rc-service said that fcron was started, on restart fcron refused to stop so could not be restarted. Hence my; kill fcron and then start it again.
suspend/hibernate detected: we woke up after 3352s instead of 900s. The system was suspended for 2450s.
That means that fcron went to sleep, expecting to be woken up 900s later to do something. Instead it woke up 3352s later, and it detected the system was suspended or hibernated for 2450s in between. It uses that suspend/hibernation duration to adjust when tasks will be executed next (e.g. @-lines).
OK, now I understand it. Thank you
I don't understand these log entries:
I have noticed similar suspend/hibernate entries (see first entry) in the logs before. In this case fcron stopped responding and I had to kill the process and restart the service. This has not happened before.
The rest of the messages I don't understand either?