From owner-freebsd-ports@FreeBSD.ORG Sun May 23 10:43:19 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78A6516A4CE; Sun, 23 May 2004 10:43:19 -0700 (PDT) Received: from wa-pullman1b-a-8.losaca.adelphia.net (wa-pullman1b-a-8.losaca.adelphia.net [67.21.169.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5337743D1F; Sun, 23 May 2004 10:43:19 -0700 (PDT) (envelope-from johnmary@adelphia.net) Received: by wa-pullman1b-a-8.losaca.adelphia.net (Postfix, from userid 1001) id D6C6A6673; Sun, 23 May 2004 10:43:17 -0700 (PDT) From: John Merryweather Cooper To: Lars Thegler In-Reply-To: <40B0A0CD.90301@thegler.dk> References: <20040523101300.GA43113@genius.tao.org.uk> <40B09066.1020300@web.de> <20040523122832.GF40899@genius.tao.org.uk> <40B0A0CD.90301@thegler.dk> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1085334195.978.7.camel@borgdemon.losaca.adelphia.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sun, 23 May 2004 10:43:17 -0700 cc: Josef Karthauser cc: ports@freebsd.org Subject: Re: portupgrade and daemons. X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: johnmary@adelphia.net List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2004 17:43:19 -0000 On Sun, 2004-05-23 at 06:02, Lars Thegler wrote: > Josef Karthauser wrote: > > On Sun, May 23, 2004 at 01:52:06PM +0200, Kay Lehmann wrote: > > > >>As far as I know this isn't the job of portupgrade. Normally it should > >>be handeled by the port itself, which could stop daemons with > >>appropriate set (de)install targets. > >>I think a lot of the ports do this quite properly. Moving this to Mk > >>looks quite complicated and I think it would be the best to leave it in > >>the ports, since they should know what is required to do. > > > > Ah ok. That makes sense. Do you know of a port that does this properly > > off the top of your head? > > net/smokeping stops a running daemon in its pkg-deinstall script. It > doesn't restart it after upgrade, though. Not sure whether that is a > good idea anyway. > > /Lars > It isn't the job of portupgrade, but it is a job that portupgrade can handle. Take a look at pkgtools.conf. In mine, I've got: BEFOREDEINSTALL = { # Automatically stop the service for each package that has a # rc script enabled '*' => proc { |origin| cmd_stop_rc(origin) }, # Stop postfix 'mail/postfix*' => localbase() + '/sbin/postfix stop', } I have a similar setup further down: AFTERINSTALL = { # Re-enable the X wrapper 'x11-servers/XFree86-4-Server' => sprintf( 'cd %s/bin && if [ -x Xwrapper-4 ]; then ln -sf Xwrapper-4 X; fi', x11base()), # Automatically start the server for each package that # installs a rc file enabled '*' => proc { |origin| cmd_enable_rc(origin) }, # Start postfix 'mail/postfix*' => localbase() + '/sbin/postfix start', } I've only made a few additions to the pkgtools.conf that comes with portupgrade. jmc