From owner-freebsd-ports@FreeBSD.ORG Mon Mar 2 19:05:15 2009 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF374106582D for ; Mon, 2 Mar 2009 19:05:15 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id 67BE88FC16 for ; Mon, 2 Mar 2009 19:05:15 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 16182 invoked by uid 399); 2 Mar 2009 19:05:09 -0000 Received: from localhost (HELO slave.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 2 Mar 2009 19:05:09 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Date: Mon, 2 Mar 2009 11:05:07 -0800 (PST) From: Doug Barton To: Oliver Lehmann In-Reply-To: <20090302163843.cc66c55e.lehmann@ans-netz.de> Message-ID: References: <20090302163843.cc66c55e.lehmann@ans-netz.de> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! X-OpenPGP-Key-ID: 0xD5B2F0FB Organization: http://www.FreeBSD.org/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: ports@freebsd.org, stable@freebsd.org Subject: Re: restart a script in etc/rc.d 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, 02 Mar 2009 19:05:20 -0000 On Mon, 2 Mar 2009, Oliver Lehmann wrote: > Hi, > > I've below etc/rc.d bacula-fd and I copied it to bacula-fd2 because I > need to run 2 file daemons. > I'Ve modified every variable for the 2nd start script to be independent > from the first one. > It works so far but when I issue etc/rc.d/bacula-fd restart it also stops > the process started by bacula-fd2 probably because > > + _find_processes /usr/local/sbin/bacula-fd . -ax > > gets executed or whatever. > > Is there a way in the rc.d scope to define to only look for the pid in > the pid file (why do we have them anyway when we search everytime) and > only kill the PID listed in the pid file? Well that is certainly how it is supposed to work, and that script defines pidfile which should prevent it from doing what you're suggesting. So let's check your work. :) To accomplish what you want you would have to change all of the following in your duplicate script: 1. filename (IOW, you need 2 scripts with different names) 2. PROVIDE 3. name= 4. rcvar= (If you redefine $name that should be enough) 5. pidfile= 6. The names of the variables in the default assignments Also, the assignment of pidfile should really come after the defaults are set. If you do all that and it still doesn't work, send a diff of your two rc.d scripts to the list. hope this helps, Doug -- This .signature sanitized for your protection