Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Mar 2009 16:38:43 +0100
From:      Oliver Lehmann <lehmann@ans-netz.de>
To:        stable@freebsd.org
Cc:        ports@freebsd.org
Subject:   restart a script in etc/rc.d
Message-ID:  <20090302163843.cc66c55e.lehmann@ans-netz.de>

next in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090302163843.cc66c55e.lehmann>