From owner-freebsd-ports@FreeBSD.ORG Sat Apr 5 18:58:07 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 293541065674 for ; Sat, 5 Apr 2008 18:58:07 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from exhub015-1.exch015.msoutlookonline.net (exhub015-1.exch015.msoutlookonline.net [207.5.72.93]) by mx1.freebsd.org (Postfix) with ESMTP id F25038FC0A for ; Sat, 5 Apr 2008 18:58:06 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from smgellar.p6m7g8.net (70.88.236.22) by smtpx15.msoutlookonline.net (207.5.72.103) with Microsoft SMTP Server (TLS) id 8.1.263.0; Sat, 5 Apr 2008 11:58:06 -0700 Message-ID: <47F7CBBD.4050107@p6m7g8.com> Date: Sat, 5 Apr 2008 14:58:05 -0400 From: "Philip M. Gollucci" Organization: P6 Web Applications User-Agent: Thunderbird 2.0.0.9 (X11/20071217) MIME-Version: 1.0 To: Maxim Khitrov References: <26ddd1750804041811p4bb2c4f5tbab3f9659f88e8bb@mail.gmail.com> In-Reply-To: <26ddd1750804041811p4bb2c4f5tbab3f9659f88e8bb@mail.gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org Subject: Re: FreeBSD Custom Package Server X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2008 18:58:07 -0000 Maxim Khitrov wrote: > First question I have is if anyone is aware of software that already > does this sort of thing? How well does it work? If not, I plan try to > write this on my own. $ id ftp uid=14(ftp) gid=14(ftp) groups=14(ftp) $ grep ^ftp /etc/inetd.conf ftp stream tcp nowait root /usr/libexec/ftpd ftpd -4 -A -l -l -r M -s $ mkdir -p /home/ftp/pub/FreeBSD/ports/distfiles $ mkdir -p /home/ftp/pub/$ENV/FreeBSD/ports/$arch/package-$version You can maintain 1 host with multiple jail(8)s. Each will have a custom /etc/make.conf. You can even different architectures for in different jails. In my experience, you should have 1 jail for each different software stack (aka set of packages). In large production environments, its very typical to have 'classes' of machines. AKA proxy machines, app machines, database machines..... Each set would have a different set of packages. On the clients just do export PACKAGESIITE=ftp://ftp.host.tld/pub/$ENV/FreeBSD/ports/$arch/package-$version/Latest/ trailing '/' is important. then $ pkg_add -r $pkg An example /etc/make.conf: DISTDIR=/home/ftp/pub/FreeBSD/ports/distfiles PACKAGES=/home/ftp/pub/FreeBSD/ports/amd64/packages-8-current WITHOUT_DEBUG= yes WITHOUT_EXAMPLES= yes WITHOUT_IPV6= yes WITHOUT_NLS= yes WITH_MODPERL2= yes WITH_MYSQL= yes WITH_MYSQL_VER= 51 WITH_DBD_VER= 44 APACHE_PORT= www/apache22 OVERRIDE_LINUX_BASE_PORT= f8 BATCH= yes .if ${.CURDIR:M*/usr/ports/databases/mysql5*} BUILD_OPTIMIZED= yes WITH_NDB= yes .endif ...... In ~/bin a good way to build stuff might be: #!/bin/sh pkgs="\ shells/bash \ security/sudo \ editors/vim-lite \ net/rsync \ ftp/curl \ devel/strace \ sysutils/screen \ " cd /var/db/pkg pkg_delete -f * for pkg in $pkgs; do cd /usr/ports/$pkg make fetch-recursive done for pkg in $pkgs; do cd /usr/ports/$pkg make all install done for pkg in $pkgs; do cd /usr/ports/$pkg make package-recursive done for pkg in $pkgs; do cd /usr/ports/$pkg make clean done If you pay attention to what you are doing, you can NFS mount the ports tree on the clients, b/c portupgrade needs it, and do something like the following to automatically install packages that have updates (via cron even) In the build jails: $ pkgdb -L $ portsdb -u $ pkgdb -u $ portversion -l '<' -v $ portsclean -C $ portsclean -DD $ PKG_PATH=$pkg_path portupgrade -abpPr # runs portsclean -L # runs pkgdb -aF You don't need to ssh to them, you can just cron it on each client if you want: $ for machine in $machines; do set -x ssh root@${machine}.domain.tld "PACKAGESITE=$pkgsite PACKAGES=/tmp portupgrade -abPPr" set +x done HTH -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) c:703.336.9354 Consultant / http://p6m7g8.net/Resume/resume.txt http://riderway.com / http://ridecharge.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching.