Petr Slechta piitr at
Tue Jan 19 15:08:55 UTC 2010


I have a little problem with the "at" package.
In the package "at" in file "atd.c" at line 586 there is following code:
	    if ((buf.st_nlink == 1) && (run_time + CHECK_INTERVAL <= now)) {
		/* Remove stale lockfile FIXME: lock the lockfile, if you fail, it's still in use. */

The value of the constant CHECK_INTERVAL is one hour.
If the job is running longer than this one hour, then it will be removed from the spool directory.
The atq will not show it even it is still running.
My jobs are often much longer and it is a problem they become invisible.
Would be possible to create another constant (e.g. CLEANUP_INTERVAL) and use it at the line 586 instead of CHECK_INTERVAL?
The value should be higher, I would like at least one day.

May be the value of the original CHECK_INTERVAL could be decreased to one minute.
I think the checking each minute is not a problem because the checking routine is very smart (it uses stat()).
The decreasing would eliminate following problem:
We create a new job with the "at" command.
After creation of the job file the HUP signal will be sent to the "atd" process.
If the signal is received just before the "sleep" at line 799 (in atd.c), it will be lost.
The job will be run after one hour even if it should be run after e.g. 5 minutes.
The probability is low but it can be a problem.
If you change the value of the CHECK_INTERVAL to one minute, this problem would disappear.
Never the less, this constant is used at line 601, too.
I do not understand what this part does but the value used here should be probably greater than 1 minute.
But I realy do not know when this is run. May be never?

I would appreciate if you do something with it.
I think I am not the only one who uses this package.

have a nice day,

More information about the Ubuntu-devel-discuss mailing list