Subject: Re: CVS commit: pkgsrc/mk
To: None <jlam@NetBSD.org>
From: Robert Elz <kre@munnari.OZ.AU>
List: tech-pkg
Date: 09/10/2003 19:05:46
    Date:        Tue,  9 Sep 2003 11:00:31 +0000 (UTC)
    From:        "Johnny C. Lam" <jlam@NetBSD.org>
    Message-ID:  <20030909110031.9D9E1B004@cvs.netbsd.org>

  | Check that the lockfile isn't stale from being left over across a system
  | reboot by testing whether or not /var/run/dmesg.boot is newer than it or
  | not.  Fix suggested by agc@NetBSD.org and simonb@NetBSD.org.

This is really a very poor idea for pkgsrc - the existence of that file
is optional even in NetBSD (it needs dmesg=YES in rc.conf - which is the
default, but can be disabled) - the file name can also trivially be changed
(dmesg_file=/var/log/dmesg.boot in rc.conf is what I prefer).

That said, this probably does no real harm, it is unlikely that there
will be a dmesg.boot in /var/run whose mod time is so recent as to cause
lock files to be discarded improperly - but nor can it really be expected
to do much good in all cases either.

Probably better would be for pkgsrc to have a boottime startup script,
that actually records (for pkgsrc purposes) the time that the system
rebooted (or that pkgsrc was re-initialised, if that makes any sense)
and that pkgsrc can rely upon existing, regardless of what OS happens
to be running (no idea about Darwin, but I doubt that Solaris has a
/var/run/dmesg.boot file...)

If such a system startup script was created, it could do more than just
record the "locks older than this must be dead" time - it could perhaps
even clean up those dead locks, so the issue would never arise (and
every later pkgsrc build would not need to check for ancient locks),
and anything else that might be nice to have pkgsrc do, or check, at
system boot time.

kre