Date: Tue, 2 Jan 2001 22:35:32 +0100 From: Gerhard Sittig <Gerhard.Sittig@gmx.net> To: freebsd-hackers@FreeBSD.org Subject: Re: how to test out cron.c changes? (was: cvs commit: src/etc cr Message-ID: <20010102223532.W253@speedy.gsinet> In-Reply-To: <XFMail.010102113620.jhb@FreeBSD.org>; from jhb@FreeBSD.org on Tue, Jan 02, 2001 at 11:36:20AM -0800 References: <20010102133239.V253@speedy.gsinet> <XFMail.010102113620.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 02, 2001 at 11:36 -0800, John Baldwin wrote: > > [ manpage diff for cron.c change reasoning ] > > I must've missed this the first time through. I hoped that silence is not always meant in a negativ way. :> See my first message to freebsd-hackers as of December 5th at http://www.freebsd.org/cgi/getmsg.cgi?fetch=211030+217815+/usr/local/www/db/text/2000/freebsd-hackers/20001210.freebsd-hackers > This looks ok to me, though I'm curious if the 3 hour window is > tweakable either by a compile time knob or a run time command > line switch? 3 hours for the default would be ok... The code is taken verbosely from the FreeBSD -> OpenBSD diff of cron (modulo capability / gcc / other unrelated patches the OpenBSD version has, but both are based on vixie cron). The decision you refer to looks like this: + wakeupKind = -1; + if (timeDiff > -(3*MINUTE_COUNT)) + wakeupKind = 0; + if (timeDiff > 0) + wakeupKind = 1; + if (timeDiff > 5) + wakeupKind = 2; + if (timeDiff > (3*MINUTE_COUNT)) + wakeupKind = 3; + + switch (wakeupKind) { The "three times the minutes one hour has" could easily be made tweakable as soon as there's someone who knows how to propagate a compile time option into a *.c file. :) I'm not clear where to put this thing: /usr/src/usr.sbin/cron/Makefile, some header file, cron.c beginning, ...? Well, the trigger level probably should live in a public variable, get initialized with a #define'd value (tweakable in the Makefile) and overridden at argv[] parse time. This should give all the benefits of leaving it alone, editing source before compile time as well as providing an argument at run time. But let's wait with this until the feature is worth at all to make it into FreeBSD. :) Unless this decision depends on the possibility to tweak the trigger level ... :> I guess I will have to roll the current state (stuck since early December when the silence started:) into a PR to have a base for further discussions and most of all review. There are chances I did something stupid (cut the diff too much / too little) and there's room for improvement (like your turnable knob as well as making the above operate on "more readable" enums and the like). Give me a few days to sort my stuff. Although I didn't want to bother you with (functionally) untested patches, I fail to see any other way of making possible progress in this special feature's case -- discussions would be too much in theory without the patch getting published. Unless somebody could tell me how to test it here locally -- to save other peoples' time by not publishing unfinished code ... BTW: Thank you for CC'ing me. Otherwise there would be turn around times of some five days when I had to follow the thread via the web interface. :) virtually yours 82D1 9B9C 01DC 4FB4 D7B4 61BE 3F49 4F77 72DE DA76 Gerhard Sittig true | mail -s "get gpg key" Gerhard.Sittig@gmx.net -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010102223532.W253>