Date: Thu, 12 Jul 2001 10:30:14 -0700 (PDT) From: Tim Kientzle <kientzle@acm.org> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/28920: periodic scripts do not run on desktop systems that aren't always on Message-ID: <200107121730.f6CHUEv78912@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 28920 >Category: misc >Synopsis: periodic scripts do not run on desktop systems that aren't always on >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jul 12 10:40:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Tim Kientzle >Release: 4.3 Release >Organization: Independent Software Consultant >Environment: FreeBSD ugly.kientzle.com 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Thu Jun 14 11:18:04 PDT 2001 root@ugly.kientzle.com:/usr/src/sys/compile/UGLY i386 >Description: System periodic scripts are run from crontab in the wee hours of the morning. If the system isn't on all the time, those scripts never run. This causes a variety of problems: locate is useless, security checks are never performed, /tmp cleanup never happens, etc. >How-To-Repeat: Turn off your computer at 5pm. Turn it back on at 9am and note that root has no email. ;-) >Fix: The obvious workaround: leave the system on all the time. This is impossible for some (laptops), and undesirable for many others (electricity is getting more expensive). A more involved solution is to rewrite the 'periodic' program called by crontab so that: * It is run at frequent intervals. * It keeps a database recording when each periodic task was last run. * If the system is on at 2am (or some other preferred time), it will preferentially run periodic tasks at that time. Thus, servers and other always-on systems will have exactly the same behavior as before: all periodic tasks are run at a predictable time. * If a periodic task is significantly overdue (due to the system being off), then it will get run at other times at reduced priority. I've written a replacement for 'periodic' that does all of the above. It's written in Perl and is very nearly a drop-in replacement that provides the same user-land behavior as the standard 'periodic'. It would certainly make sense to have this revised periodic installed separately, though, since it does operate a bit differently. Full source available on request. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107121730.f6CHUEv78912>