ifstated (mis)use?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ifstated (mis)use?

Mark Wiater-2
Perhaps I'm trying to misuse ifstated. I was hoping that you all
could shed some light and set me straight. Pointers to documentation
that I've mised would be appreciated, i just can't seem to find any.

In addition to monitoring my carp interfaces, and pinging my next
hop upstream, I wanted to be able to react to the local process
list. Whether an application is running. (I have applications that
I'd like to run on the master but not on the backup).

The problem that I experience involves the use of the -d command
line switch.

Given the following test in my ifstated.conf:

        openvpn_running = '("ps aux | grep -v grep | grep openvpn" every 10)'

with the following test:

        if  $openvpn_running{
                run "/usr/local/sbin/openvpn --config
/etc/openvpn/openvpn.conf --ifconfig 172.29.1.2 172.29.1.1 "
        }

When I use the -d option, my console fills with messages telling me
that ifstated is doing what i expect. If in another shell I kill the
openvpn process, ifstated sees that and restarts openvpn.

If I let ifstated run as it normally would, without the -d. I can
kill the openvpn process but ifstated doesn't restart the application.

It would be valuable to me to be able to start and stop processes
(and therefore be able to check the running process list) given the
state change of the local machine. Is there a better way?

Thinking that I was dealing with output redirection inside of
ifstated and all of those pipes, I even went so far as to implement
a slightly modified version of this
http://www.monkey.org/openbsd/archive2/tech/200010/msg00010.html
without a change in behavior.

Thanks for any help

Mark