From owner-freebsd-hackers Thu Jul 26 22:52: 6 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ns.morning.ru (ns.morning.ru [195.161.98.5]) by hub.freebsd.org (Postfix) with ESMTP id 5741C37B405 for ; Thu, 26 Jul 2001 22:52:01 -0700 (PDT) (envelope-from poige@morning.ru) Received: from NIC1 ([195.161.98.236]) by ns.morning.ru (8.9.3/8.9.3) with ESMTP id NAA30330; Fri, 27 Jul 2001 13:51:30 +0800 (KRAST) (envelope-from poige@morning.ru) Date: Fri, 27 Jul 2001 13:52:40 +0800 From: Igor Podlesny X-Mailer: The Bat! (v1.52 Beta/7) UNREG / CD5BF9353B3B7091 Organization: Morning Network X-Priority: 3 (Normal) Message-ID: <136343488199.20010727135240@morning.ru> To: dchapes@ddm.crosswinds.net ((Dave Chapeskie)) Cc: Matthew Jacob , hackers@FreeBSD.ORG Subject: Re[2]: perhaps one of phk's "intern" projects? In-Reply-To: <20010726211728.B89345@ddm.crosswinds.net> References: <20010726154548.I18705-100000@wonky.feral.com> <20010726211728.B89345@ddm.crosswinds.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > On Thu, 26 Jul 2001, Matthew Jacob wrote: >> It'd be nice if one could pass a time specification to at in the form >> of "next reboot". look... there is a big difference between time specification in at-program and suggested reboot keyword... I'd say it is like incompatible types... messing up time values and conditions like reboot which are certainly kept within time but AREN'T time values by itself. from man: "... At allows some moderately complex time specifications. ..." but it's always foreseen when precisely the action will have it place if the power is on and everything in system works ok. In case of reboot, this statement fails. So, I deem, it's not worth implementation within 'at' syntax. If somebody want such thing as 'do something on the next reboot', let's write another program (call it onreboot for e.g.) and try to use it. Although I bet, it isn't so necessary as it could seemed at first glance. >> >> -matt > On Thu, 26 Jul 2001, Matthew Emmerton replied: >> Why not just write a script for the command and stick it in >> /usr/local/etc/rc.d? >> >> -- Matt Emmerton > On Thu, Jul 26, 2001 at 03:45:58PM -0700, Matthew Jacob replied: >> Because I thought this might be of general utility. > Okay, try the attached patch. If this is really something that might be > generally usefully I can submit the patch as a PR. > It allows "at reboot" and "at reboot + 1 hour", etc. > It does it by sticking the job in the queue with the filename prefixed > with "_" (yeah, a bit ugly, it was the first thing that came to me) and > with the runtime based on the epoch instead of the current time. > Adding: > @reboot root /usr/libexec/atrun -b > to /etc/crontab causes atrun(8) to rename all of these jobs adding the > current time to the jobs runtime. > % echo "echo test" | at reboot > Job 19 will be executed using /bin/sh > % echo "echo test" | at reboot + 90 minutes > Job 20 will be executed using /bin/sh > % atq > Date Owner Queue Job# > REBOOT dchapes c 19 > REBOOT+01:30:00 dchapes c 20 what if a user rebooted the box, before this REBOOT+1:30:00 has been occured? will it be discarded or what? > $ date; /usr/libexec/atrun -b > % atq -v > Date Owner Queue Job# > 22:34:00 07/26/01 dchapes c 20 > 21:04:00 07/26/01 dchapes c(done) 19 -- Igor mailto:poige@morning.ru To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message