restart a script in etc/rc.d
dougb at FreeBSD.org
Mon Mar 2 11:31:58 PST 2009
On Mon, 2 Mar 2009, Oliver Lehmann wrote:
> 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)
4. rcvar= (If you redefine $name that should be enough)
6. The names of the variables in the default assignments
Also, the assignment of pidfile should really come after the defaults are
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,
This .signature sanitized for your protection
More information about the freebsd-stable