From owner-freebsd-ports@FreeBSD.ORG Mon Sep 25 13:24:58 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC12E16A415 for ; Mon, 25 Sep 2006 13:24:58 +0000 (UTC) (envelope-from bsd-unix@earthlink.net) Received: from pop-satin.atl.sa.earthlink.net (pop-satin.atl.sa.earthlink.net [207.69.195.63]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5321B43D58 for ; Mon, 25 Sep 2006 13:24:58 +0000 (GMT) (envelope-from bsd-unix@earthlink.net) Received: from fl-71-54-28-212.dhcp.embarqhsd.net ([71.54.28.212] helo=kt.weeeble.com) by pop-satin.atl.sa.earthlink.net with smtp (Exim 3.36 #1) id 1GRqS7-0007cV-00; Mon, 25 Sep 2006 09:24:55 -0400 Date: Mon, 25 Sep 2006 09:27:10 -0400 From: Randy Pratt To: Erwin Van de Velde Message-Id: <20060925092710.d340d816.bsd-unix@earthlink.net> In-Reply-To: <200609251035.15484.erwin.vandevelde@ua.ac.be> References: <200609251035.15484.erwin.vandevelde@ua.ac.be> X-Mailer: Sylpheed version 2.2.9 (GTK+ 2.8.20; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org Subject: Re: Restarting services 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: Mon, 25 Sep 2006 13:24:58 -0000 On Mon, 25 Sep 2006 10:35:15 +0200 Erwin Van de Velde wrote: > Dear all, > > Almost every port containing a service stops the service before updating but > does not restart it afterwards. I was wondering how difficult it can be to > restart the updated service after installing the files? In my opinion, it > would be less error-prone than hoping for the administrator to remember > restarting all updated services... > While this depends on every port maintainer, a general guideline about this > would help and encourage maintainers to do this. I took a look at /usr/local/etc/pkgtools.conf and it may be possible to do what you want from there. I noticed pre-defined functions like: # cmd_start_rc(origin_or_pkgname) # Returns a command line string that starts the services of the # given package, if any. (Yields "start" for each enabled rc # script) # cmd_restart_rc(origin_or_pkgname) # Returns a command line string that restarts the services of the # given package, if any. (Yields "stop", sleeps for 3 seconds, then # yields "start" for each enabled rc script) There is also a provision for running commands "AFTERINSTALL". However, I have not used these so there may be some aspects of it that I'm overlooking but its probably worth consideration. Randy --