Re: corosync.conf syntax checking

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

 



On 04/12/12 20:08 +0100, Fabio M. Di NItto wrote:
On 12/04/2012 05:10 PM, Dan Frincu wrote:
Hi,

Using corosync 1.4.2 (debian backports) and have noticed that if one
messes up corosync.conf in the logging section it still works, but not
as expected.

For example I had

logging {
        fileline: off
        to_stderr: yes
        to_logfile: yes
        to_syslog: /var/log/corosync/corosync.log
        to_syslog: no
        syslog_facility: daemon
        debug: off
        timestamp: on
        logger_subsys {
                subsys: AMF
                debug: off
                tags: enter|leave|trace1|trace2|trace3|trace4|trace6
        }
}

Used to_syslog twice instead of logfile and to_syslog. Corosync
started without any errors, and without any logs.

to_syslog accepts only yes|no. The first entry would set to default (no
IIRC) and the second one would override the first entry and set it to
"no" (for sure). Default log file is set to
/var/log/cluster/corosync.log. If /var/log/cluster doesn't exists, it
would fail to open the log file (aka no logs again).


Probably should bail early, maybe do some syntax checking.

Just saying.

Patch? ;)

The idea is nice, there is no doubt about it, but it's almost "mission
impossible" given the complexity (and not just for logging). Not sure
maybe Jan has an idea how to fix it easily.

Have augeas run the parser over it in the init script?

So I just ran this on my config I had.

augtool ls /files/etc/corosync/
augtool ls /augeas/files/etc/corosync/corosync.conf/error
I get:
pos = 46
line = 2
char = 0
lens = /usr/share/augeas/lenses/corosync.aug:179.10-.81:
message = Iterated lens matched less than it should

So looking at line 2: I had compatibility in my config
I removed that.
augtool ls /files/etc/corosync/corosync.conf/ #comment = Please read the corosync.conf.5 manual page
totem/ = (none)
logging/ = (none)
quorum/ = (none)

Then changed to your logging config:
to_logfile = <filename>
to_logfile = no

augtool ls /files/etc/corosync/corosync.conf/ augtool ls /augeas/files/etc/corosync/corosync.conf/error
pos = 1872
line = 51
char = 0
lens = /usr/share/augeas/lenses/corosync.aug:179.10-.81:
message = Iterated lens matched less than it should

line 51 points to the top of the logging section.

I have to say the output is not particularly user friendly.
But it does check the syntax, and it can be figured out.

-Angus


Fabio

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss
_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux