Date: Fri, 27 Jul 2001 13:52:40 +0800 From: Igor Podlesny <poige@morning.ru> To: dchapes@ddm.crosswinds.net ((Dave Chapeskie)) Cc: Matthew Jacob <mjacob@feral.com>, hackers@FreeBSD.ORG Subject: Re[2]: perhaps one of phk's "intern" projects? Message-ID: <136343488199.20010727135240@morning.ru> In-Reply-To: <20010726211728.B89345@ddm.crosswinds.net> References: <Pine.BSF.4.21.0107261650250.97678-100000@xena.gsicomp.on.ca> <20010726154548.I18705-100000@wonky.feral.com> <20010726211728.B89345@ddm.crosswinds.net>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?136343488199.20010727135240>