[Pkg-sysvinit-devel] Bug#584862: sysv-rc: calculate the seconds correctly :)
Petter Reinholdtsen
pere at hungry.com
Wed Jul 21 20:02:16 UTC 2010
tags 584862 + patch
thanks
[Peter Pentchev]
> Hi,
>
> First of all, thanks for your work on sysvinit and friends!
Thank you.
> What do you think of the following patch which handles the case of the time
> zone changing while rc*.d scripts are being run? Currently, /etc/init.d/rc
> may report things like "Running scripts in rc0.d/ tool -10787 seconds" :)
> And yes, I know it's marked to be removed before Squeeze is out, but still,
> if there is a sysvinit upload in the meantime, this might be a quick and
> easy thing to fix :)
>
> Once again, thanks for your work on sysvinit and Debian in general!
>
> G'luck,
> Peter
Sound like a useful patch for bug #584862. Thank you. Cc to the BTS
report and tagging it patch.
> Index: debian/src/sysv-rc/etc/init.d/rc
> ===================================================================
> --- debian/src/sysv-rc/etc/init.d/rc (revision 1940)
> +++ debian/src/sysv-rc/etc/init.d/rc (working copy)
> @@ -336,7 +336,10 @@
> # This code should be removed when Squeeze freeze is getting closer
> # - Petter 2010-05-18
> endtime=$(date +%s)
> -duration=$(($endtime - $starttime))
> +duration=$((($endtime - $starttime) % 3600))
> +if [ "$duration" -lt 0 ]; then
> + duration=$(($duration + 3600))
> +fi
> log_action_msg "Running scripts in rc$runlevel.d/ took $duration seconds"
>
> exit 0
Did you test this change with dash as /bin/sh?
Happy hacking,
--
Petter Reinholdtsen
More information about the Pkg-sysvinit-devel
mailing list