On Tue, May 27, 2008 at 3:20 AM, Jordan Brown <Jordan.Brown at sun.com> wrote:
>
> Hmm.  I view cron jobs as services.  They're just like those things that run
> in the background; they just don't run all the time.  I'd consider them to
> be much like a service that executes in a loop with a "sleep".

Cron is the service. Crontabs are just data.

(Waiting for the day someone suggests that smf becomes a mail spool.
It provides service guarantees right, so each message is a service and
smf is responsible for reliable delivery.)

>>>> Would each cronjob get its own service name, or its own instance name?
>>>
>>> Yes.  (Which, I'm not sure.)
>>
>> Oh great. svcs lists 10,000 entries...
>>
>> This idea clearly doesn't scale.
>
> 10K seems like a pretty large number; do you have any real systems with even
> multiple hundred cron jobs?  (Solaris ships with 6; RHEL looks like,
> depending on definitions, it ships with about 16.)

Not currently (fortunately!); but I've managed at least one system that was
up well over a thousand (we had to significantly increase the queue limit).
I wouldn't be surprised to come across systems that have many more cron
jobs than traditional smf services.

> But yes, perhaps svcs would need to have some kind of filtering.  The first
> would probably be that (by default) it'd show only *your* cron jobs.

It would have to; you can't see another user's crontab at the moment.

I just see smf as the wrong tool.

>> Well, yes, that's one of the problems with the current scheme. I would
>> love to 'crontab add' or 'crontab delete' a job without having to use or
>> emulate an editor. Could easily be done by making each entry a separate
>> file in a directory. Just deliver or remove the file
>
> That's a reasonable add/delete strategy, but doesn't give you
> enable/disable.  Also, if you (as I do) view them as equivalent to services,
> it seems like they should be managed the same way that services are managed.
>
>> (on an inactive image,
>> anyway - on a live image you need to ping cron).
>
> Cron could check the directory mod time every minute or two.

Or hook into a proper event mechanism. (gamin?) You really don't want
more applications randomly stat()ing all the time.

-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/

Reply via email to