From owner-freebsd-bugs Thu Jul 12 10:40:15 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7993A37B407 for ; Thu, 12 Jul 2001 10:40:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f6CHe0k79919; Thu, 12 Jul 2001 10:40:00 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D38C537B408 for ; Thu, 12 Jul 2001 10:30:14 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f6CHUEv78912; Thu, 12 Jul 2001 10:30:14 -0700 (PDT) (envelope-from nobody) Message-Id: <200107121730.f6CHUEv78912@freefall.freebsd.org> Date: Thu, 12 Jul 2001 10:30:14 -0700 (PDT) From: Tim Kientzle To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/28920: periodic scripts do not run on desktop systems that aren't always on Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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