monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: starting service order


From: Sebastien ESTIENNE
Subject: Re: starting service order
Date: Tue, 06 Jul 2004 16:59:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040629

Jan-Henrik Haukeland wrote:


2) a kind of ordering, or at least, the ability to not startup the
subsequent service in the list if the previous did not already completed
to startup _without_ using a dependency

it could be implemented by keywords like before/after
Gentoo linux already provide this functionnality (look here: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml? part=2&chap=5#doc_chap4 )
you can define order with before after
dependencies need/use and also provide

for example you can say that qmail "provide mta" and "need  net"
and that nagios "need mta"

so the system knows that he must start qmail before nagios (if you had use the "use" keyword instead of "need" it means that qmail can fail it's okà

"provide" is also because you can say that many service provide the same functionnality, eg: mta -> qmail, postfix, exim


(1) Interesting idea. It sounds like something that monit could benefit from. It means that we need to replace dependency in monit with the keyword "need" and add the keyword "use" for start order and as a weak dependency. (If I got this right?)

Yes that's right, i think we can use the gentoo doc and meaning of these keyword as a basis, as i said in another mail, gentoo has a really finegrained services order and dependency system (it's explain in the docs here: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml? part=2&chap=5#doc_chap4) but it missed the great features of monit and could benefit a lot of it.

3) some tool to easily rearrange the services (a chkconfig-like tool) 4)
the ability tu support different runlevels

I wrote this tool, it was easy, i just modified the default tool from gentoo (it was just a matter of 5 lines)


Care to share the tool with the list?

of course i can share it, i didn't do i yet because it's really gentoo specific (i modified the default tool)
If you want i could wrote a lite version of it just for monit.
It's just a matter of managing symlinks and tell monit to reread it's config file (plus some sanity checks).

and i don't see why monit couldn't do this?
for example djb's daemontools where built to manage services (they manage qmail/djbdns) and monit seems to be a daemontools++. too bad he also missed the ability to define services start order...

I think that monit can remplace the default system, because the onlyt things that the default init system has to do, is stating/stopping system in the right order nothing more

If we missed this it doesn't mean that it cannot be changed. I also think that you can use monit with success as a replacement for sysinit startup scripts, but means to set the start order is needed, (2) In addition monit should have the ability to start a process without depending on a pid file. (As stated in the first comment to monit here, http://freshmeat.net/projects/monit/) I.e. monit needs to listen to the SIGCHLD signal for processes it start, so if a child dies monit get a signal and can restart the process. I haven't looked at the init nor the daemontools code, but I'm pretty sure this is what those programs do. The reason we don't do this already is that monit was (initially) designed to monitor processes that was started outside of monit's control. (To listen for SIGCHLD monit must start the process).

that's maybe why in system using daemontools (runit for example) all services are child or the monitoring process (svscan/supervise), and the service MUSTN'T fork to be monitored by daeamontools


I think as a start we should add (1) and (2) to our TODO list. What do the other commiters think?

Marco suggested in his email some threading to not "block" monit process while it is starting another process, and also to be able to "see" if a process is in "starting in progress" state.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]