Page MenuHomeFreeBSD

cron: Implement -s command option
Needs ReviewPublic

Authored by otis on Jul 11 2021, 2:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 26 2024, 5:27 AM
Unknown Object (File)
Feb 1 2024, 6:10 AM
Unknown Object (File)
Dec 25 2023, 11:47 PM
Unknown Object (File)
Dec 20 2023, 5:24 AM
Unknown Object (File)
Nov 15 2023, 4:14 PM
Unknown Object (File)
Oct 1 2023, 6:18 AM
Unknown Object (File)
Sep 26 2023, 7:35 AM
Unknown Object (File)
Sep 12 2023, 12:51 AM

Details

Reviewers
None
Group Reviewers
manpages
Summary

Based on an idea suggested by Job Snijders <job@sobornost.net>,
a -s command option has been implemented, with great deal of inspiration
from OpenBSD.

When used, it allows only a single instance of given command
to run at once, allowing the next one to run only after the previous
one finishes.

For this to happen, job queue has been reworked to use queue instead
of a simple linked list.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40504
Build 37393: arc lint + arc unit

Event Timeline

otis requested review of this revision.Jul 11 2021, 2:21 PM

The man page part looks good, but I am a little bit confused, on my FreeBSD systems I see

root 66156 0.0 0.0 12800 1680 - Is 7Jul21 0:04.38 /usr/sbin/cron -s

when executing 'ps axuw'. So it seems, that some kind of a '-s' option is already implemented.

In D31146#701876, @gbe wrote:

The man page part looks good, but I am a little bit confused, on my FreeBSD systems I see

root 66156 0.0 0.0 12800 1680 - Is 7Jul21 0:04.38 /usr/sbin/cron -s

when executing 'ps axuw'. So it seems, that some kind of a '-s' option is already implemented.

That's a command option for cron, the change has to do with crontab entries, see crontab.5 and its example:

# run every minute, only send mail if ping fails
* * * * *       -n ping -c 1 freebsd.org
usr.sbin/cron/cron/job.c
26

This is in the wrong order, if I'm not misunderstanding style(9).

36

Shouldn't old code be removed instead of commented out?

otis marked 2 inline comments as done.Jul 16 2021, 8:04 PM
bcr added a subscriber: bcr.

Approving the man page part.
Hope we can get it committed soon.