Hi, I upgraded my Soekris 4801 boxes from 8.1 to 8.2-STABLE (r221326) a few days ago and now I get the following error in the daily mail: Backing up package db directory: tar: : Cannot stat: No such file or directory tar: Error exit delayed from previous errors. These messages originate from /etc/periodic/daily/220.backup-pkgdb, apparently a recent addition. The culprit is probably on line 21: make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR "/usr/share/mk/bsd.port.mk", line 11: Could not find /usr/ports/Mk/bsd.port.mk make: fatal errors encountered -- cannot continue If there is no /usr/ports present on the system, the script will fail. Of course my systems are not unique in this respect: many people install pre-built packages instead of building ports themselves, especially on minimal hardware configurations. Would it be a good idea to check for the presence of /usr/ports (or /usr/ports/Mk/bsd.ports.mk) first before calling make, and then try $PKG_DBDIR and /var/db/pkg, in that order, if this is not the case? As far as I know this issue also affects 9.0-CURRENT. Kind regards, Hans Ottevanger
On Wed, May 04, 2011 at 01:49:06PM +0200, Hans Ottevanger wrote:> I upgraded my Soekris 4801 boxes from 8.1 to 8.2-STABLE (r221326) a > few days ago and now I get the following error in the daily mail: > > Backing up package db directory: > tar: : Cannot stat: No such file or directory > tar: Error exit delayed from previous errors. > > These messages originate from /etc/periodic/daily/220.backup-pkgdb, > apparently a recent addition.CC'ing committer and author.> The culprit is probably on line 21: > > make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR > "/usr/share/mk/bsd.port.mk", line 11: Could not find > /usr/ports/Mk/bsd.port.mk > make: fatal errors encountered -- cannot continue > > If there is no /usr/ports present on the system, the script will > fail. Of course my systems are not unique in this respect: many > people install pre-built packages instead of building ports > themselves, especially on minimal hardware configurations.Agreed.> Would it be a good idea to check for the presence of /usr/ports (or > /usr/ports/Mk/bsd.ports.mk) first before calling make, and then try > $PKG_DBDIR and /var/db/pkg, in that order, if this is not the case?Again, agreed. Others may have other recommendations/solutions that are equally palatable. Overall, the script needs some more test conditionals for added ""error"" checking. I should also take a moment to point out a PR I just created tonight for RELENG_7, since this periodic script did get backported to that branch. PR pertains to tar(1) on RELENG_7 complaining about leading slashes on stderr, while RELENG_8 and newer do not due to differences in each respective branches' util.c: http://www.freebsd.org/cgi/query-pr.cgi?pr=156810 -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP 4BD6C0CB |
On 05/04/2011 04:49, Hans Ottevanger wrote:> Hi, > > I upgraded my Soekris 4801 boxes from 8.1 to 8.2-STABLE (r221326) a few > days ago and now I get the following error in the daily mail: > > Backing up package db directory: > tar: : Cannot stat: No such file or directory > tar: Error exit delayed from previous errors. > > These messages originate from /etc/periodic/daily/220.backup-pkgdb, > apparently a recent addition. > > The culprit is probably on line 21: > > make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR > "/usr/share/mk/bsd.port.mk", line 11: Could not find > /usr/ports/Mk/bsd.port.mk > make: fatal errors encountered -- cannot continueThanks, I'll take a look. -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/
On 05/04/2011 04:49, Hans Ottevanger wrote:> make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR > "/usr/share/mk/bsd.port.mk", line 11: Could not find > /usr/ports/Mk/bsd.port.mk > make: fatal errors encountered -- cannot continueI fixed this in HEAD by setting the default if pulling it from make fails. I will MFC ASAP. -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/
On 05/05/11 04:43, Doug Barton wrote:> On 05/04/2011 04:49, Hans Ottevanger wrote: >> make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR >> "/usr/share/mk/bsd.port.mk", line 11: Could not find >> /usr/ports/Mk/bsd.port.mk >> make: fatal errors encountered -- cannot continue > > I fixed this in HEAD by setting the default if pulling it from make > fails. I will MFC ASAP. > >Of course this will solve my "problem" 8-) But if you use something like pkg_dbdir=${PKG_DBDIR-/var/db/pkg} you will also cover the (infrequent) case where people redefine PKG_DBDIR while running pkg_add et al (and actually remember to set PKG_DBDIR in /etc/crontab !). Kind regards, Hans Ottevanger