monit-general
[Top][All Lists]
Advanced

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

Re: Path and argument problem... solution?


From: Christian Hopp
Subject: Re: Path and argument problem... solution?
Date: Fri, 30 Aug 2002 14:02:45 +0200 (CEST)

On 30 Aug 2002, Jan-Henrik Haukeland wrote:

> Christian Hopp <address@hidden> writes:
>
> > Just little things...
> >
> > 1) Beautification... I try to give lonesome quotes comments with
> >    quotes to fix syntax highlighting. (status->done)
> >
> > 2) I think we should use my string quote trimmer to have the
> >    possibility to use double quotes in single quoted strings. (second
> >    example above)   (status->done)
>
> Yes, please, add your code. You forgot to attach it to the mail you
> sent so I had problems including it :)

It was in l.l not in utils.c (-: But now it's in the right place in
utils.c and I have committed it. And also some stuff in l.l.


> > 3) We should capture escaped chars (at least the important ones): "\t",
> >    "\n", "\ ".  (status->not yet done)
>
> You're right about that. Any ideas?

I have seen a pattern in portfwd or in php.  I think I can handle it.


> > 4) We should add a possibility to a some kind of variables like
> >    "$pid", "$service", "$checksum", ...  in first I thought of using
> >    an environment variable for it but there is no execve, just execle.
> >    And that would be a not so nice hack.  An other possibility would
> >    be to substitute the variables at start time. (status->wish)
>
> I'm not quite sure what you mean, please explain. BTW environment
> variable in exec sounds pretty dangerous.

For get about environment... it won't work.

Example:

check foo /var/run/foo
   stop = "/bin/foo --service $service --pid $pid"

and we substitute $service, or however we call the tokens...
...that the command would be at the time of execution like,

   stop = "/bin/foo --service foo --pid 12345"

What do you think?


> > > Another thing. The spawn command for starting programs from monit
> > > should send an alert message when it fails to execute a program.
> > >
> > > Because we need to free memory before the execv it's not easy to do
> > > this nice. For now I have changed the function's signature to take a
> > > Process_T object as well as a Command_T object. The idea is that the
> > > mailinglist in the Process_T object can be used to send an alert mail
> > > if spawn (i.e. execv) fails to start a program. I have to think a bit
> > > more on how to do this and any suggestions are welcome!
> >
> > Return it as a wait to the fork and do the exit after a timeout?
>
> Because of the double fork I do not think this is possible?

I mean in the time for the second for, we can wait() for the child for
e.g. 5 seconds.  No response => okay, response=0 => okay,  response!=0
=> alert,log,etc.


> > but I became a programmer of a language which does not need this
> > puny brackets... python. (-:
>
> Urk, isn't python the language where indentions are significant?

Not, urk, ohoh!!! And it is the language where you group statements
with indenting.  You have a really good looking code.  I think I have
started with it '97.  And I use it for quite a lot of different
stuff.  I think I would call it my "preferred" language for everything
beyond a kernel driver and what's not absolutely time critical.  For
the later there are quite comfortable C-bindings.  I hope I haven't
started a "language jihad". (-:

Christian



-- 
Christian Hopp                                email: address@hidden
Institut für Elektrische Informationstechnik             fon: +49-5323-72-2113
Technische Universität Clausthal                         fax: +49-5323-72-3197
  pgpkey: https://www.iei.tu-clausthal.de/pgp-keys/chopp.key.asc  (2001-11-22)





reply via email to

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