From owner-freebsd-ports@FreeBSD.ORG Sun Sep 12 14:46:22 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D93181065673 for ; Sun, 12 Sep 2010 14:46:22 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 890498FC1B for ; Sun, 12 Sep 2010 14:46:22 +0000 (UTC) Received: by gwb15 with SMTP id 15so1720363gwb.13 for ; Sun, 12 Sep 2010 07:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=fWnO9ih3iLHTJh3QtEk1h9GW604YDPNaSItaxFreKyw=; b=naUnGD4TeK3UqfVnGU8pcUZvR4PE/3VJCn1y9vqSJA+B7HnjIN7n9G9TqDBRhdUUtR 4z3lTn9Uhhv7uyokfCjYeWWO81eSzyCFFqDTwsFX7YuImeH9CHQmyi3v80xkNDTgoo6S NM7KcOHPjMWCrRuw/R2thW0U2o4F1Ph87WfWI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=GJfL4ONsHFtBjqjC72fmPW3QvmkGlwzvzP2rfv8hpjv4zEtBona0w6FFpL059Jl0mF c0XXZMGdutLkI1pXpTVPfLMRIUIN+0/GDDwheT7ErCMZQf4+S1xOYbxP88pJzrX4OZfl cPLiFvhnxNPj5UP+hM7lfTlMBpzMt43TWEF54= Received: by 10.151.132.10 with SMTP id j10mr10285ybn.334.1284302781557; Sun, 12 Sep 2010 07:46:21 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-137-20.dsl.klmzmi.sbcglobal.net [99.181.137.20]) by mx.google.com with ESMTPS id q1sm5125525ybk.8.2010.09.12.07.46.19 (version=SSLv3 cipher=RC4-MD5); Sun, 12 Sep 2010 07:46:20 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C8CE7BA.8070904@DataIX.net> Date: Sun, 12 Sep 2010 10:46:18 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.9) Gecko/20100908 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: Matthew Seaman References: <20100911222902.bb57444a.nork@FreeBSD.org> <20100911173359.68d71af6@it.buh.tecnik93.com> <20100911224547.GA35333@mail.hs.ntnu.edu.tw> <20100912094602.497f93c7@it.buh.tecnik93.com> <4C8CCF83.9010508@infracaninophile.co.uk> In-Reply-To: <4C8CCF83.9010508@infracaninophile.co.uk> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org Subject: Re: [ports/net/isc-dhcp*] Don't stop DHCP related daemons X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 14:46:22 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/12/2010 09:02, Matthew Seaman wrote: > On 12/09/2010 07:46:02, Ion-Mihai Tetcu wrote: >> And you can't really know if it's a new install or an upgrade. > > An app like portmaster or portupgrade would be able to know that. It's > an oddity of the ports/pkg system that because 'upgrade' is implemented > as 'delete' followed by 'install' that there is difficulty in making > that distinction. > > In fact, portupgrade has a nifty feature you can enable which causes it > to run '/usr/local/etc/rc.d/foo start' for any rc scripts installed by a > port it is working on. Which is almost, but not quite, exactly what is > wanted; it should issue 'restart' for services already running, or > 'start' for services stopped during the upgrade process. > If someone really wants to go for automation lets not leave it on the backs of every user that is involved with ports that offer network services but learn how to properly script out periodic(8) runs or a cron(8) job to check for the existence of that process. Line wrapage: */5 * * * * /usr/local/etc/rc.d/rcscript status \ ||/usr/local/etc/rc.d/rcscript start Or write your own periodic script that makes use of _enable etc... and put it in /usr/local/etc/periodic somewhere. People may also be interested in this, that I use for personal cron jobs that I need to schedule minutely hourly daily and such. http://bit.ly/9ODE56 Perfectly fine that tools like portmaster or portupgrade offer these things but lets not forget that its also really easy to figure out what services are going to be stopped before you start a upgrade and then restart them after using service(8) for example. Maybe it would not be such a bad idea to start a framework for a set of periodic checks that the user can configure simple by # 5 Minute Service checks minutely_check_enable="YES" # Allow disabling all 5 minute checks. minutely_check_rcscript_enable="YES" # Enable check for this rcscript. # Hourly checks # hourly_check_enable="YES" # See above hourly_check_rcscript2_enable="YES" # ... The rc.subr system should be able to handle this or service(8) by calling status and taking appropriate action for each script within an hourly_check_*_enable variable. Just some thoughts to be expanded, Regards, - -- jhell,v -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMjOe6AAoJEJBXh4mJ2FR+20cH/ReHJDra84J19WX0UJxvcA2v Z4QK/y/Tn5J3bjQ8EVOmkZIokX3EDunHrlufdIq/iaWWVKC4xhJ6DNFqJJ8zw5Mm 5zL59xO/m+uw3Fuxxc67semTvFbLhmCG/IiDTyePjfhU9rj/eV0EdAtO9auBGXgJ GNfn1QQrejoYPt/bStwBnbmPM2JHmiU1Qbu+A7MpGZRVH1flUBbIk0EQBluErEsK vvWa6LYqZsZPT3IKZvMEmIi6WQQLrEnIHgsjUNqnbw8FijPsi0fATdUxwVGUaR4T hmIfkHtLz/v0zg5nHFNcMniz+Og3nWAWP68ews0gWyYm/5gftfWobaFTRLnm4FA= =CvPi -----END PGP SIGNATURE-----