From owner-freebsd-current@FreeBSD.ORG Sun Jul 14 16:42:04 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 9CAB527F for ; Sun, 14 Jul 2013 16:42:04 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com [IPv6:2607:f8b0:4001:c03::233]) by mx1.freebsd.org (Postfix) with ESMTP id 764AB8BF for ; Sun, 14 Jul 2013 16:42:04 +0000 (UTC) Received: by mail-ie0-f179.google.com with SMTP id c10so24129647ieb.38 for ; Sun, 14 Jul 2013 09:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=k1Rkkv/oSqcCqVlK8jw8Ik3vlDlkvnA6Ah/dZ3BeDd0=; b=m2EvFCPfz9ajK0DbYGDMHy7SIbIG8nNaaOD3E5y8NDObT4ZLo4kVN0fI7AAF0PpMbm B8ctFi3zGenNLoUmu7FyfKtbn3BDlti5wvkCK1G9mw/iyk1Hnfp7R1VDwgfHOhTrmN6K Er/zdA0/qJFqkRDl6nV77t1V3DiU/UxSEFAEKUyKVOtZYztjucfF9JsMGbsRWZysQs1H fkPW4Gxfiw0oUN/s6u3BXiZKZ62hCkdm3BEgXcRZi/6MrpBuo1FAjfHtEq1NMLQ0JTLy TLED2wFMgmpgEP0vr7xF63qRqcOvlB7ZeiiBjsVmOj+v0VR2eCufyMS2u066xdzG7rKy xA1A== MIME-Version: 1.0 X-Received: by 10.43.67.73 with SMTP id xt9mr16006650icb.99.1373820124163; Sun, 14 Jul 2013 09:42:04 -0700 (PDT) Received: by 10.50.221.179 with HTTP; Sun, 14 Jul 2013 09:42:04 -0700 (PDT) In-Reply-To: References: Date: Sun, 14 Jul 2013 11:42:04 -0500 Message-ID: Subject: Re: Ports with daemons on uninstall... From: Scot Hetzel To: Ian FREISLICH Content-Type: text/plain; charset=ISO-8859-1 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 16:42:04 -0000 On Sun, Jul 14, 2013 at 10:52 AM, Ian FREISLICH 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.