From owner-freebsd-current@FreeBSD.ORG Sun Jul 14 19:17:26 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E467855C for ; Sun, 14 Jul 2013 19:17:26 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id AE3ABE99 for ; Sun, 14 Jul 2013 19:17:26 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 0A52B35931A; Sun, 14 Jul 2013 21:17:26 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id D7AC228494; Sun, 14 Jul 2013 21:17:25 +0200 (CEST) Date: Sun, 14 Jul 2013 21:17:25 +0200 From: Jilles Tjoelker To: Ian FREISLICH Subject: Re: Ports with daemons on uninstall... Message-ID: <20130714191725.GA30708@stack.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2013 19:17:27 -0000 On Sun, Jul 14, 2013 at 05:52:37PM +0200, Ian FREISLICH wrote: > 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. I think that almost all of this per-port code should be removed with pkgng. The HANDLE_RC_SCRIPTS pkg.conf option will stop/start the rc.d script during deinstallation/installation. By default, services are left running. Stopping the service on deinstall but not starting it again on install seems like a particularly bad idea. Apart from the annoyance of the restarts, automatic stopping and starting is probably the best policy for having things "just work". Some daemons will crash or otherwise stop being useful when their files have been deleted or replaced, and the new rc.d script might be unable to stop the old daemon. -- Jilles Tjoelker