monit-dev
[Top][All Lists]
Advanced

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

Re: statement changes suggestions


From: Jan-Henrik Haukeland
Subject: Re: statement changes suggestions
Date: Tue, 05 Aug 2003 00:30:50 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Civil Service, linux)

Martin Pala <address@hidden> writes:

> OK :) I'm very busy this week (we are starting new system and
> prepare migration) - i'll prepare documentation tomorrow evening i
> think.

Take your time, paid work comes first. (You do not get salt on the
table for working with monit, at least not yet :-)


> I though about permission test modification related to checksum test
> modification:
>
> Present syntax:
>
> PERM(ISSION) octal_mode
>
> New Syntax:
>
> [IF] PERM(ISSION) octal_mode [FAILED] [[THEN]  action]
>
> So you can use shortcut, for example: 'perm 755', which will behave
> same way like checksum (i.e. send alert) or you can specify long form
> in the case that you need custom action (such as stop, execute, etc.)
>
> Similar way will be uid and gid test implemented.

You may have problems with this because *if* you use action you cannot
have an empty action in the parser as the grammer is now. If you try
you will get shift/reduce errors.

That is, this will not work:

(1)
permission : PERM octal         <--- (2)
           | PERL octal action  <--- (3)
           ;

You must only use:

permission : PERL octal action
           ;
or

permission : PERM octal
           ;

The reason is (as I think I mentioned before) that action contains
keywords used in other statements, i.e. STOP, RESTART ALERT and the
shift/reduce problem occurs if you try version (1) because the parser
will not know if for instance this statement:

  PERM octal ALERT

should be reduced to the permission rule in (2) and the ALERT is part
of a new alert statement or if it should reduce the statement to (3).
This is because Bison has only 1 lookahead, and when it do not know if
it should reduce or shift (read one more token) you get a shift/reduce
error from Bison.

-- 
Jan-Henrik Haukeland




reply via email to

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