From owner-freebsd-stable@FreeBSD.ORG Mon Mar 2 16:05:27 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C9ED106564A for ; Mon, 2 Mar 2009 16:05:27 +0000 (UTC) (envelope-from lehmann@ans-netz.de) Received: from avocado.salatschuessel.net (avocado.salatschuessel.net [78.111.72.186]) by mx1.freebsd.org (Postfix) with SMTP id B37468FC08 for ; Mon, 2 Mar 2009 16:05:26 +0000 (UTC) (envelope-from lehmann@ans-netz.de) Received: (qmail 34942 invoked by uid 89); 2 Mar 2009 15:38:44 -0000 Received: from unknown (HELO kartoffel.salatschuessel.net) (78.111.72.187) by avocado.salatschuessel.net with SMTP; 2 Mar 2009 15:38:44 -0000 Date: Mon, 2 Mar 2009 16:38:43 +0100 From: Oliver Lehmann To: stable@freebsd.org Message-Id: <20090302163843.cc66c55e.lehmann@ans-netz.de> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; amd64-portbld-freebsd7.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ports@freebsd.org Subject: restart a script in etc/rc.d X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2009 16:05:27 -0000 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? root@nudel olivleh1> cat /var/run/bacula-fd.910 bacula-fd.9102.pid bacula-fd.9104.pid root@nudel olivleh1> cat /var/run/bacula-fd.910* 33076 33125 root@nudel olivleh1> ps auxww | grep bacula-fd | grep -v SsJ root 33076 0.0 0.4 8160 2980 ?? Ss 4:31PM 0:00.02 /usr/local/sbin/bacula-fd -u root -g wheel -v -c /usr/local/etc/bacula-fd.conf root 33125 0.0 0.4 8160 2980 ?? Ss 4:35PM 0:00.01 /usr/local/sbin/bacula-fd -u root -g wheel -v -c /usr/local/etc/bacula-fd2.conf root@nudel olivleh1> /usr/local/etc/rc.d/bacula-fd restart Stopping bacula_fd. Starting bacula_fd. root@nudel olivleh1> ps auxww | grep bacula-fd | grep -v SsJ root 33151 0.4 0.4 7136 2968 ?? Ss 4:36PM 0:00.01 /usr/local/sbin/bacula-fd -u root -g wheel -v -c /usr/local/etc/bacula-fd.conf root@nudel olivleh1> /usr/local/etc/rc.d/bacula-fd2 restart bacula_fd2 not running? (check /var/run/bacula-fd.9104.pid). Starting bacula_fd2. root@nudel olivleh1> ps auxww | grep bacula-fd | grep -v SsJ root 33170 0.5 0.4 7136 2968 ?? Ss 4:36PM 0:00.01 /usr/local/sbin/bacula-fd -u root -g wheel -v -c /usr/local/etc/bacula-fd2.conf root 33151 0.0 0.4 7136 2968 ?? Ss 4:36PM 0:00.01 /usr/local/sbin/bacula-fd -u root -g wheel -v -c /usr/local/etc/bacula-fd.conf -- Oliver Lehmann http://www.pofo.de/ http://wishlist.ans-netz.de/