From owner-freebsd-stable@FreeBSD.ORG Wed May 4 12:30:13 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 140B2106566C for ; Wed, 4 May 2011 12:30:13 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta15.emeryville.ca.mail.comcast.net (qmta15.emeryville.ca.mail.comcast.net [76.96.27.228]) by mx1.freebsd.org (Postfix) with ESMTP id EDC218FC0C for ; Wed, 4 May 2011 12:30:12 +0000 (UTC) Received: from omta24.emeryville.ca.mail.comcast.net ([76.96.30.92]) by qmta15.emeryville.ca.mail.comcast.net with comcast id fQ7W1g0021zF43QAFQWC5Z; Wed, 04 May 2011 12:30:12 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta24.emeryville.ca.mail.comcast.net with comcast id fQWA1g00k1t3BNj8kQWAAE; Wed, 04 May 2011 12:30:12 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 4A7FF102C36; Wed, 4 May 2011 05:30:10 -0700 (PDT) Date: Wed, 4 May 2011 05:30:10 -0700 From: Jeremy Chadwick To: Hans Ottevanger Message-ID: <20110504123010.GA89218@icarus.home.lan> References: <4DC13D32.1070503@beasties.demon.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DC13D32.1070503@beasties.demon.nl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: dougb@freebsd.org, freebsd-stable@freebsd.org, florent.thoumie@gmail.com Subject: Re: Daily backups of pkgdb failure X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 12:30:13 -0000 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 |