portupgrade and daemons.

John Merryweather Cooper johnmary at adelphia.net
Sun May 23 10:43:19 PDT 2004


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



More information about the freebsd-ports mailing list