Date: Sun, 23 May 2004 10:43:17 -0700 From: John Merryweather Cooper <johnmary@adelphia.net> To: Lars Thegler <lars@thegler.dk> Cc: ports@freebsd.org Subject: Re: portupgrade and daemons. Message-ID: <1085334195.978.7.camel@borgdemon.losaca.adelphia.net> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1085334195.978.7.camel>