From owner-freebsd-isp@FreeBSD.ORG Fri May 22 17:14:49 2009 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 107DC106566C for ; Fri, 22 May 2009 17:14:49 +0000 (UTC) (envelope-from fb-isp@psconsult.nl) Received: from mx1.psconsult.nl (psc11.adsl.iaf.nl [80.89.238.138]) by mx1.freebsd.org (Postfix) with ESMTP id 50ECC8FC17 for ; Fri, 22 May 2009 17:14:47 +0000 (UTC) (envelope-from fb-isp@psconsult.nl) Received: from mx1.psconsult.nl (localhost [80.89.238.138]) by mx1.psconsult.nl (8.14.2/8.14.2) with ESMTP id n4MGlJYV084412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 May 2009 18:47:24 +0200 (CEST) (envelope-from fb-isp@psconsult.nl) Received: (from paul@localhost) by mx1.psconsult.nl (8.14.2/8.14.2/Submit) id n4MGlJZN084411 for freebsd-isp@freebsd.org; Fri, 22 May 2009 18:47:19 +0200 (CEST) (envelope-from fb-isp@psconsult.nl) Date: Fri, 22 May 2009 18:47:19 +0200 From: Paul Schenkeveld To: freebsd-isp@freebsd.org Message-ID: <20090522164719.GA83655@psconsult.nl> Mail-Followup-To: freebsd-isp@freebsd.org References: <4A166B29.1070202@interazioni.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A166B29.1070202@interazioni.it> User-Agent: Mutt/1.5.17 (2007-11-01) Subject: Re: Avoiding source code on production servers X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 17:14:49 -0000 On Fri, May 22, 2009 at 11:06:49AM +0200, Tonix (Antonio Nati) wrote: > I'm in the phase of planning my new generation of FreeBSD servers, and I > would love to make them more easy to upgrade. > Main problem I have currently is I do not want any source code on > production server, so freebsd-update is welcome, but... what about > packages? > I would use packages, but they are not easy to upgrade, while ports can be > easy to upgrade, but need to have sources an servers. > > What do you suggest me? What is currently done on other environments? I've spent a lot of time over the last three years trying to automate maintenance of source-free servers. Ports are a real challenge. Other work with embedded systems (Soekris) has brought me the idea of using nanobsd(8) for servers. Although it may sound strange at first, experiments I'm currently undertaking give very promising results. The operating system and all ports are put into a read-only mounted root filesystem. /etc is a malloc-backed memory filesystem which gets filled by "standard" /etc contents part copied into /conf/base/etc in the root filesystem and then gets overlayed by modified files which are saved in a separate /cfg filesystem that you can mount read-write when changing configuration. /var, /home and other filesystems with user data are normal rw filesystems. Each server has two slices holding a root filesystem each, one is active and the other will be used to upload a new image when upgrading or adding software. After upgrading this alternate root slice you have to reboot the server so if you cannot tolerate a reboot, nanobsd is not for you. A roll-back is very easy if the new root does not satisfy you, just reboot and select the old slice to boot. Many of my servers have all applications hidden in jails, this makes this solution even easier as the host operating system ususally is very small on such servers. Each jail can be maintained and upgraded in a similar way, I keep a spare jail around to prepare the upgeade of / and /usr parts of application jails, stopping and restarting an application jail with the new /+/usr slice upgrades the software in the jail, rollbacks are easy as well. -- Paul Schenkeveld