|
From: | Martin Pala |
Subject: | Re: depend take 2 |
Date: | Wed, 18 Dec 2002 10:08:05 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021210 Debian/1.2.1-3 |
Jan-Henrik Haukeland wrote:
I think we speak about same thing, but thinking about foo and bar in juxtaposition :)Martin Pala <address@hidden> writes:Jan-Henrik Haukeland wrote:Hmm, the depend functionality is much better but still does not work as expected. I'm going to work a bit with on it. In case anyone are planning doing stuff with changing control.c let me know.I looked on it too - i think it will be probably better to make it more independent on the rest of control.c. Probably it will be better to use model proposed by Jan for it (dependancy matrix) => build process dependency relationship outside process structure (avoid use of process state variables).I just realized that I'm not going to be able to finish a release of the zervlet system before after Christmas. So I can let it rest for some days and work a bit on monit which I haven't done for a while. I want to test and see if it is possible to refactor the depend logic a bit before we do a beta release.In addition i think (again) that it will be better to use statement "depend foo" as declaration for "slave" processes that they depend on process foo, for example to define that bar depends on foo: new proposal: ### check foo with pidfile "/var/run/foo.pid" ... check bar with pidfile "/var/run/bar.pid" depend foo ... ### instead of present: ### check foo with pidfile "/var/run/foo.pid" depend bar ... check bar with pidfile "/var/run/bar.pid"If you mean, foo->bar, that is, foo depends on bar to run before it starts, I think that the present syntax is better, since you can sort of read it like: "check foo and depend on bar to be running".
Preposition:There are processes foo and bar. Foo will not start until bar is up and running (foo depends on bar), in SYSVR5 language (just for start-up order example - it doesn't take care about real state of bar):
/etc/rc3.d/S98bar /etc/rc3.d/S99foo 1.) Summary of present logic:You must declare all dependencies for the master process configuration, so value of "depend" statement is name of the process, that should be started AFTER process where "depend" statement is mentioned:
### check bar with pidfile "/var/run/bar.pid" depend foo ... check foo with pidfile "/var/run/foo.pid" ... ### => check bar and its dependant foo that should be runned after bar 2.) Summary of the other (proposed) design:You must use depend statement to declare master process, so value of "depend" statement is process, that should be started BEFORE process where "depend" statement is mentioned:
### check bar with pidfile "/var/run/bar.pid" ... check foo with pidfile "/var/run/foo.pid" depend bar ... ### => check foo and depend on bar to be running before fooBoth designs are possible, it just about the "feeling". I thing second version is more usual/nature in real world, but it doesn't matter :)
Martin
[Prev in Thread] | Current Thread | [Next in Thread] |