[Top][All Lists]

[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 12:01:26 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040629

Marco Ermini wrote:

<quota chi="Sebastien ESTIENNE">
To provide such a service, you should define:

1) the ability for a dependency to fail

Yes that's i was asking if this feature exist, it could be implemented
like this

depends on apache_bin can fail
or a new keyword that would do the same thing named "before"

This would sound cool.

<quota chi="Sebastien ESTIENNE">
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:
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


No, I never used gentoo (that's a fault, actually, since I think I sould
try it...). Just having a quick look at that web page (so don't think I am
actually "judging" or something similar, it's just the first impression of
a Unix sysadmin - and I _can_ change my mind, I'm not that kind of
sensitive :-), it sounds like it's a way to manage system startup too much
complicated for an Unix sysadmin' "average" taste; it seems like it adds
complexity that it's not worth the cause. When I configure an MTA I want
in fact it doesn't add complexity but choice, because on unix many software provide the same functionnality:
eg: syslog, metalog, syslog-ng -> logger
fcron dcron vcron -> crontab
postfix , exim, qmail -> mta

so this dependecie system can work with any "brick" as long as it provide the same functionnality. In my opinion it's great for sysadmin, because every sysadmin has his fav tools, and in gentoo, doesn't assume any default tool, so that every tool are well integrated in the system, for example in redhat postfix is the default, and it works great in redhat but if you want to put qmail instead, you have quite some work to make it integrates as well as postfix, in my opinion that's why gentoo is a meta-distribution, and that it can fits different need, because they assume no default, that's the same for the logger, the cron, the db, and many other things i forget about, ah yes, Java, in gentoo, you can use whatever jdk you want (sun, ibm, blackdown, ....) you can even install the 3 and then choose which one you want to use with a tool (java-config, the system jvm can be different than users 'jvms). And i'd like to integrate monit in the same spirit, i don't want it to replace the current system, i want it to be an alternative, and (if possible) a complement of the default system, to assist it in monitoring system.

it to work and work the way I want: I don't want a "replacement" MTA to
start if my MUA fails, since I spent time configuring _my_ MTA, the MTA I
_choosed_, with my blacklists, anti-spam etc. etc. - and it's actually a
_cost_ to configure two different software in the same way "just in the
sorry i think i wasn't clear, it was not about configure 2 mta, it's about to be able to choose the one that fits your need, and keep the system still fully functionnal whatever mta your choosed

Finally, I think that your idea would add some level of complexity to
monit, which may be useful, but I don't know if the authors would like -
let's see what they think about that :-)

yeah it would be great to have their opinion about this :)

<quota chi="Sebastien ESTIENNE">
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)
I did it like this:
in /etc/monitrc i added  "include /etc/monit.d/autostart/*"
in /etc/monit.d/ i put a file by service (eg: apache postfix mysql)
and the tool just write or remove a link from /etc/monit.d/ in
so i have the exact same functionnality as a tool like chkconfig
(i don't know if you use gentoo, but now i add services like this:
rc-update add apache monit)

I didn't know about how gentoo works, but this sounds interesting: adding
and removing a service from monit with a command it could be useful... but
maybe you can just unmonitor it? :-)
i thought about this, but it was so much easier to do it this way, and it is also much more consistent why how gentoo does things. Gentoo is different from redhat/debian in the the way they don't care about sysV runlevel 1-6, runlevels have a name and you can define as much runlevel as you want, (even there is 2/3 default one) the standar one is "default" so i just added one called "monit", that way you choose if you service is manage with the "default" system or the "monit" one :)

Anyway it seems to me this is just a way of using monit: adding or
removing a file from a directory is just a matter of a 5 line script (like
you already said) and this did not require any modification to monit - I

i don't modification in monit for thiss functionnality, the "includes" work perfectly, i'm just missing "order" functionnality, or just being able to say that a dependencie can fail. nothing more

<quota chi="Sebastien ESTIENNE">
you said that monit is only good in specialized situation, or when
customized, it's true, but you can define default and then allow the
user to provide custom settings without modifying the default install,
using include:
the default, would only check for pid, and listening port and then the
user can overide things or adding things by including his configuration:
/etc/monit.d/system/SERVICE <- contain all default service config
and each SERVICE contain a line like this at the end: include
so when a user want to customized apache for example, he just have to
create a file /etc/monit.d/user/apache

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
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...

The first thing I usually think is that a program should serve the purpose
it was being created for. The "Unix way" of thinking is: simple tools to
be put together in a simple way. Changing Monit to being more complex to
serve a different purpose for what it was conceived for, sounds to a
"Unix" mind like mine (a little simple and orthodox, I think ;-) like some
kind of "noise" I don't need to listen to ;-)

in fact it's my mistake i thought that monit was designed to a be possible init replacement

Anyway you can do it... adding a feature to monit it's not forbidden by
the law ;-) and two of the features you suggested (dependencies which can
fails, and the order of startup) could be useful to the "conventional" way
of using Monit, too (I think).

I think that there is a much more useful option which is missing: the
"startup in progress" option... when a service is long to startup (think
about Java application servers, ecc.), Monit becomes unresponsive if you
ask for a "status".

thanx for pointing this, now i understantd why "monit status" sometimes fail :D

I think that starting a service should spawn a different thread and
changing the status in "startup in progress" (this would need to be
configurable from the monitrc file). This could also be useful in a
"system startup" situation like you want for gentoo, as it would speed up
the startup of the whole system if you have services which didn't need to
be "dependable" from each others.

In fact gentoo already speed things up, because it can start services in parallel when they don't depend on another one.

but you are right "starting in progress feature" and threading would be really usefull features too!.

reply via email to

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