|
From: | Wheeler, John |
Subject: | RE: copy action trigger another action |
Date: | Thu, 9 Jan 2003 13:20:36 -0600 |
I do this right now to facilitate central logging and log rotation. Maybe I don't understand your question. What do you mean by "trigger an action"?
import:
nsswitch.conf
control:
actionsequence = (
editfiles.syslog
copy.syslog
process.syslog
shellcommand.syslog
editfiles:
syslog::
{ /etc/hosts
BeginGroupIfNoSuchLine "0.0.0.0 loghost loghost.eb.com"
ReplaceAll "loghost" With ""
GotoLastLine
Append "0.0.0.0 loghost loghost.eb.com"
EndGroup
}
copy:
syslog::
/cfengine/classes/corp/etc/syslog.conf
dest=/etc/syslog.conf
mode=644
type=checksum
inform=true
server=$(masterhost)
define=hupsyslogd
syslog.corp28::
/cfengine/classes/corp28/etc/init.d/syslog
dest=/etc/init.d/syslog
mode=744
type=checksum
inform=true
server=$(masterhost)
define=restartsyslogd
processes:
syslog.hupsyslogd::
"syslogd"
signal=hup
inform=true
syslog.restartsyslogd::
"syslogd"
restart "/etc/init.d/syslog stop;/etc/init.d/syslog start"
inform=true
shellcommands:
syslog.restartsyslogd::
'/usr/bin/logger -p user.warning "warn:restarted syslogd"'
syslog.hupsyslogd::
'/usr/bin/logger -p user.warning "warn:restarted syslogd"'
> -----Original Message-----
> From: Nate Campi [mailto:nate@campin.net]
> Sent: Thursday, January 09, 2003 10:41 AM
> To: help-cfengine@gnu.org
> Subject: copy action trigger another action
>
>
> I'm interested in people's thoughts on whether it would be
> useful to have successful copies trigger an action. I'm
> thinking along the lines of sending a HUP to a daemon when
> it's config file is updated.
>
> With most daemons it is fine to simply HUP every time cfagent
> runs, but with syslog-over-tcp my connections drop and have
> to restablish every time the syslog daemon is HUP'd. During
> the period that the connection is waiting to re-establish
> (one minute) the buffering logs might overflow and start
> getting dropped before being sent on to the loghost when the
> connection is re-established.
>
> I'd imagine I could write a cfengine module to do this, but
> I'm not much of a programmer and would rather it was
> implemented in the core and done Right(tm).
>
> Thoughts?
> --
> Nate Campi http://www.campin.net
>
> "A round man cannot be expected to fit in a square hole right
> away. He
> must have time to modify his shape." - Samuel Clemens
>
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-> cfengine
>
[Prev in Thread] | Current Thread | [Next in Thread] |