From owner-freebsd-questions@FreeBSD.ORG Mon Oct 31 15:36:52 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B4E6316A41F for ; Mon, 31 Oct 2005 15:36:52 +0000 (GMT) (envelope-from infofarmer@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2953F43D46 for ; Mon, 31 Oct 2005 15:36:52 +0000 (GMT) (envelope-from infofarmer@gmail.com) Received: by zproxy.gmail.com with SMTP id x3so891535nzd for ; Mon, 31 Oct 2005 07:36:51 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=puRvsteAg3pG5kPXt+5x2D9nab1F/IkFAcsJfuUrDl3tg/m8gWb96g5NXHJczwCVd6enujhLmlgxdirAPazPzlX8frQmde9FkCguwbPVcyCViNrq1+gtDzz6N5dVLiD+qHB8hf1+lTB43TqwAkTvGAvK3abBSSQ8tDrx0TSQ/eo= Received: by 10.36.71.20 with SMTP id t20mr1550798nza; Mon, 31 Oct 2005 07:36:51 -0800 (PST) Received: by 10.37.20.34 with HTTP; Mon, 31 Oct 2005 07:36:51 -0800 (PST) Message-ID: Date: Mon, 31 Oct 2005 18:36:51 +0300 From: "Andrew P." To: John DeStefano In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200510281922.16495.ringworm01@gmail.com> Cc: FreeBSD Questions Subject: Re: portupgrade stale dependencies X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2005 15:36:52 -0000 On 10/31/05, John DeStefano wrote: > On 10/31/05, Andrew P. wrote: > > On 10/31/05, John DeStefano wrote: > > > On 10/30/05, Andrew P. wrote: > > > > On 10/31/05, John DeStefano wrote: > > > > > On 10/29/05, Andrew P. wrote: > > > > > > On 10/29/05, John DeStefano wrote: > > > > > > > > > > > > > > Needless to say, this process wasn't much fun. What can I do= to keep > > > > > > > this from happening again? What can/can't I safely include i= n cron to > > > > > > > automate database and index maintenance? > > > > > > > > > > > > > > > > > > > cvsup or portsnap, then portsdb -uUF. Work under > > > > > > any circumstances, leave you with updated ports > > > > > > tree and indexes. > > > > > > > > > > If I were to continue to use portsnap, which arguments can I safe= ly > > > > > add to /etc/crontab? I know "portsnap cron" should be safe, but i= f I > > > > > want to completely automate the update process (not for installin= g > > > > > packages, but for keeping the ports tree, database, and indexes > > > > > current), should I also add an entry for "portsnap update" and > > > > > "portsdb -uUF"? > > > > > > > > > > > > > > > > > You can also try portupgrade -aF (prefetches > > > > > > needed files to speed up manual upgrade at a later > > > > > > time) and portsclean -DP (removes sources and > > > > > > packages which become outdated due to ports > > > > > > tree updates). > > > > > > > > > > > > > > > > Would you also recommend cron entries for these two commands? > > > > > > > > > > I used to use a cron job to run cvsup, and I'd like to implement = a > > > > > better, more complete automated solution, so I don't tangle up my > > > > > system's packages and dependencies again. > > > > > > > > > > > > > I think the best way is to create a shell script, like this: > > > > > > > > #!/bin/sh > > > > /usr/local/sbin/portsnap cron && \ > > > > /usr/local/sbin/portsnap update && \ > > > > /usr/local/sbin/portsdb -uUF && \ > > > > /usr/local/sbin/portupgrade -aF && \ > > > > /usr/local/sbin/portsclean -DP > > > > > > > > > > Perfect... I had everything but the && conditionals... thanks! > > > > > > > > > > > and run it at an hour, when you're most unlikely to > > > > perform any kind of port upgrading. As portsnap > > > > manpage warns, if both portsnap (in the process > > > > of update) and portupgrade ever happen to access > > > > the same directory at once, it might ruin your > > > > ports tree. You'll have to do "portsnap extract" > > > > after that. You can leave out portsclean and run > > > > it manually, because it can create some load > > > > (which is not desirable on a production server). > > > > > > > > I run this script daily at 8-9 in the morning (I usually > > > > start messing with servers after 11). It never failed, > > > > and it always keeps everything up-to-date. > > > > > > > > > > My server is not "production", as it's just my personal web/database > > > server; I'm the only one who would be running any updates. So I > > > should be okay with this procedure, and I'll manually update any port= s > > > of note. > > > > > > Just one problem I saw thus far, with portsclean I think... > > > > > > Cleaning out /usr/ports/packages... > > > cd: can't cd to /usr/ports/packages/All > > > find: /usr/ports/packages: No such file or directory > > > > > > Would this be related to one of the "advanced topics" you mentioned > > > earlier about pkgtools.conf? ;) Do I need to define some variables? > > > I would guess the directory error to have been caused by a combinatio= n > > > of the variables PORTSDIR (which looks okay at /usr/ports) and > > > PACKAGES (which seems to need a /packages dir beneath PORTSDIR ). > > > > > > Thanks, > > > ~John > > > > > > > No, it's not advanced at all :-) You just don't have the > > directory. Create it, if you want to. When you run > > "make package" or "portupgrade -p something", a > > package is created in your current directory, unless > > /usr/ports/packages exists. If it does, the package > > is created there, and some hierarchy is kept, too. > > So it's convenient to have that dir, if you ever use > > packages. > > > > Of course, /usr/ports/packages is just the default. > > You can change "PACKAGES" to whatever you like. > > > Thanks Andrew. You're right: that's not advanced, even for me! If > that dir needs to have a specific set of permissions, please let me > know; otherwise, I think I'm all set, aside from asking where I might > read more about the ports/packages system that what's in the handbook > and man pages. > > Thanks again for your help. > ~John > The default (755) permissions should be ok. The ultimate (more or less) ports/packages documentation consists of: ports(7) make(1) pkg_add(1) pkg_create(1) pkg_delete(1) pkg_info(1) pkg_version(1) /usr/ports/Mk/* The Porter's Handbook The FreeBSD Handbook ("Packages and Ports") pib(1), portaudit(1), portcheckout(1), portlint(1) portupgrade(1), etc - depending on what tools you have installed. ports@ mailing list archives and various makefiles throughout the system are also valuable sources of documentation.