restart a script in etc/rc.d

Oliver Lehmann lehmann at ans-netz.de
Mon Mar 2 07:38:48 PST 2009


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 at nudel olivleh1> cat /var/run/bacula-fd.910
bacula-fd.9102.pid  bacula-fd.9104.pid  
root at nudel olivleh1> cat /var/run/bacula-fd.910*
33076
33125
root at 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 at nudel olivleh1> /usr/local/etc/rc.d/bacula-fd restart
Stopping bacula_fd.
Starting bacula_fd.
root at 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 at 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 at 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/


More information about the freebsd-ports mailing list