Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jul 2013 11:42:04 -0500
From:      Scot Hetzel <swhetzel@gmail.com>
To:        Ian FREISLICH <ianf@clue.co.za>
Cc:        current@freebsd.org
Subject:   Re: Ports with daemons on uninstall...
Message-ID:  <CACdU%2Bf-ndoLBppVeSVnK=vFBY1qrYARWFftBmppUXO3JV6XrPA@mail.gmail.com>
In-Reply-To: <E1UyObF-0000Rh-P5@clue.co.za>
References:  <E1UyObF-0000Rh-P5@clue.co.za>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 14, 2013 at 10:52 AM, Ian FREISLICH <ianf@clue.co.za> wrote:
> Hi
>
> I have to ask if there's a standard for the way ports should handle
> their daemons when the port is uninstalled.
>
> I've encountered 3 varients of ports behaviour on uninstall:
>
> 1. Do nothing
> 2. Stop the daemon
> 3. Ask if the daemon should be stopped
>
> #1 closely followed by #3 are the least irritating when it comes
> to portupgrade because you can at least have the service running
> while upgrading.  At least with #3 the upgrade gets paused until
> the propmpt is answered and you're then aware that some service
> will go away immediately so you can be prepared to restart it.
>
> #2 is extremely irritating because upgrading with portupgrade etc
> kills the service.  For instance isc-dhcpd* does this which means
> that for some time, dhcp may be unavailable.  It could be less
> irritating if it would automatically start the service, but that
> can have its own problems.
>
> Does the project have a preferred method for handling running
> daenmons on uninstall?  I know that Linux will even start daemons
> on install.
>

Personally, I prefer that when uninstalling a port, that the daemon
gets stopped.  But if you are upgrading a port, then you will want the
daemon to be re-started.

This should be possible with the new pkg tools, but I don't know if it
is implemented:

pkg install isc-dhcpd42-server
- pkg installs the port doesn't start service
- admin starts service with /usr/local/etc/rc.d/isc-dhcpd start

pkg upgrade isc-dhcp42-server
- pkg checks the repository and finds a new version and asks if you
want it installed
- pkg checks if the service(s) is running, saves the status for later
- pkg uninstalls the old port
- pkg installs the new port
- pkg checks the saved status to see if it needs to restart the service(s)

pkg uninstall isc-dhcpd42-server
- pkg uninstalls the port and stops the service if running


-- 
DISCLAIMER:

No electrons were maimed while sending this message. Only slightly bruised.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACdU%2Bf-ndoLBppVeSVnK=vFBY1qrYARWFftBmppUXO3JV6XrPA>