cron(8) improvement

Nikolai Lifanov lifanov at mail.lifanov.com
Tue Nov 5 18:37:23 UTC 2013


On 11/05/13 13:28, Allan Jude wrote:
> On 2013-11-05 13:21, Mark Felder wrote:
>>
>> On Tue, Nov 5, 2013, at 11:37, Nikolai Lifanov wrote:
>>> On 11/05/13 12:31, Allan Jude wrote:
>>>> This came up in discussion on IRC and I thought I should throw it at the
>>>> list so I don't forget.
>>>>
>>>> A user was asking how to do what linux cron does, where there is a
>>>> directory /etc/cron.d/ that packages and add files to to create crontabs.
>>>>
>>>> Making FreeBSD's cron (Vixie Cron) include /etc/cron.d/ and
>>>> /usr/local/etc/cron.d/ in the /etc/crontab format seems like a very
>>>> useful feature, especially for pkg(8) as it makes it easy and safe to
>>>> programatically add and remove crontabs as part of a package.
>>>>
>>>>
>>> Shouldn't we encourage packages to use periodic(8) when possible?
>>>
>> Yes but our default periodic configuration in /etc/crontab is only
>> configured to be as granular as daily. If this is something that should
>> run hourly or at very strange intervals then cron is a better choice.
>>
>> If the application is installing its own user they could install their
>> own crontab file in /var/cron/tabs. I'm certain I've seen a couple ports
>> do this.
>> _______________________________________________
>> freebsd-current at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-current
>> To unsubscribe, send any mail to "freebsd-current-unsubscribe at freebsd.org"
> I don't have a specific example off the top of my head, but I am sure
> there are some daemons that needs to do something at some interval as
> root. Personally I am not so sure about having a package create a
> crontab automatically. It seems like a POLA violation, but it is also
> something that seems to be expected by some modern applications. I
> assume it is mostly handled by pkg-message currently, and maybe it is
> best to continue that way, but having the additional flexibility may be
> very useful.
> 
> If for nothing else, it would be a lot prettier than the way I currently
> manage crontabs using puppet.
> 

I would be frustrated if a port installed a root cron job without my
intervention. How about an RC extension that dynamically adds these?
Think 'drupal_cron_enable="YES"'. I just think that there should be
something an operator does, either explicitly or through configuration
management, to add a cron job for root. We don't auto-enable daemons, so
we should not auto-add these either.

- Nikolai Lifanov



More information about the freebsd-current mailing list