[Csync2] Strange behavior with pattern/exec
Youri LACAN-BARTLEY (NUXIT)
youri at ispfr.net
Thu Sep 27 14:42:14 CEST 2007
Hi all,
first a great thanks to Clifford Wolf for his work on csync2.
However, I'm running into a strange problem regarding the use of a
pattern in an action bloc.
When I edit a file in /etc/munin the exec command is properly executed
on the host where I launch csync2 -xv, ie. /etc/init.d/munin-node
restart is run.
However on any other host of the group, /usr/sbin/apachectl graceful is
executed while the pattern doesn't correspond.
The csync config file is identical on all hosts and if remove the
do-local clause from the /etc/munin pattern bloc, /usr/sbin/apachectl
graceful is run on every single host whithout modifying anything in
either /etc/apache or /etc/php4/apache.
I'm runnin csync2 1.33 on debian sarge and would really appreciate any
help on this issue.
Thanks a lot.
Here are my two action blocs.
action
{
pattern /etc/munin/*.conf;
pattern /etc/munin/plugins/*;
exec "/etc/init.d/munin-node restart";
logfile "/var/log/csync2_action.log";
do-local;
}
action
{
pattern /etc/apache/*.conf;
pattern /etc/php4/apache/php.ini;
exec "/usr/sbin/apachectl graceful";
logfile "/var/log/csync2_action.log";
do-local;
}
Here's the full log from one of the hosts:
<14825> My hostname is cpl-web2.
<14825> Database-File: /var/lib/csync2/cpl-web2.db
<14825> Config-File: /etc/csync2.cfg
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> Running check for /etc/munin/munin-node.conf ...
<14825> SQL: SELECT filename from file where filename =
'/etc/munin/munin-node.conf' ORDER BY filename
<14825> SQL Query finished.
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> Checking /etc/munin/munin-node.conf.
<14825> SQL: SELECT checktxt FROM file WHERE filename =
'/etc/munin/munin-node.conf'
<14825> SQL Query finished.
<14825> SQL: SELECT 1 FROM dirty WHERE filename =
'/etc/munin/munin-node.conf' LIMIT 1
<14825> SQL Query finished.
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> SQL: delete from dirty where filename =
'/etc/munin/munin-node.conf' and peername = 'cpl-web1'
<14825> SQL: insert into file (filename, checktxt) values
('/etc/munin/munin-node.conf',
'v1%3Amtime=1190896311%3Amode=33188%3Auid=0%3Agid=0%3Atype=reg%3Asize=814')
<14825> Updated /etc/munin/munin-node.conf from cpl-web1.
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> SQL: INSERT INTO action (filename, command, logfile) VALUES
('/etc/munin/munin-node.conf', '/etc/init.d/munin-node%20restart',
'/var/log/csync2_action.log')
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> Running check for /etc/munin/munin-node.conf ...
<14825> SQL: SELECT filename from file where filename =
'/etc/munin/munin-node.conf' ORDER BY filename
<14825> SQL Query finished.
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> Checking /etc/munin/munin-node.conf.
<14825> SQL: SELECT checktxt FROM file WHERE filename =
'/etc/munin/munin-node.conf'
<14825> SQL Query finished.
<14825> SQL: SELECT 1 FROM dirty WHERE filename =
'/etc/munin/munin-node.conf' LIMIT 1
<14825> SQL Query finished.
<14825> SQL: delete from dirty where filename =
'/etc/munin/munin-node.conf' and peername = 'cpl-web1'
<14825> SQL: insert into file (filename, checktxt) values
('/etc/munin/munin-node.conf',
'v1%3Amtime=1190896311%3Amode=33188%3Auid=0%3Agid=0%3Atype=reg%3Asize=814')
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> Running check for /etc/munin/munin-node.conf ...
<14825> SQL: SELECT filename from file where filename =
'/etc/munin/munin-node.conf' ORDER BY filename
<14825> SQL Query finished.
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> Checking /etc/munin/munin-node.conf.
<14825> SQL: SELECT checktxt FROM file WHERE filename =
'/etc/munin/munin-node.conf'
<14825> SQL Query finished.
<14825> SQL: SELECT 1 FROM dirty WHERE filename =
'/etc/munin/munin-node.conf' LIMIT 1
<14825> SQL Query finished.
<14825> SQL: delete from dirty where filename =
'/etc/munin/munin-node.conf' and peername = 'cpl-web1'
<14825> SQL: insert into file (filename, checktxt) values
('/etc/munin/munin-node.conf',
'v1%3Amtime=1190896311%3Amode=33188%3Auid=0%3Agid=0%3Atype=reg%3Asize=814')
<14825> Match (+): /etc/munin on /etc/munin/munin-node.conf
<14825> SQL: delete from dirty where filename =
'/etc/munin/munin-node.conf' and peername = 'cpl-web1'
<14825> SQL: insert into file (filename, checktxt) values
('/etc/munin/munin-node.conf',
'v1%3Amtime=1190896308%3Amode=33188%3Auid=0%3Agid=0%3Atype=reg%3Asize=814')
<14825> SQL: SELECT command, logfile FROM action GROUP BY command, logfile
<14825> SQL Query finished.
<14825> SQL: SELECT filename from action WHERE command =
'/usr/sbin/apachectl%20graceful' and logfile = '/var/log/csync2_action.log'
<14825> SQL Query finished.
<14825> Running '/usr/sbin/apachectl graceful' ...
<14825> ERROR: Waitpid returned error No child processes.
More information about the Csync2
mailing list