Quoting Zeev Fisher <zeevf@il.marvell.com> (2003-02-25 01:16:26 GMT):
I have the following in my editfiles section :
{ /etc/sysconfig/network
BeginGroupIfNoSuchLine "NISDOMAIN=$(domain)"
DeleteLinesMatching "^NISDOMAIN.*"
Append "NISDOMAIN=$(domain)"
EndGroup
DefineClasses "RestartNis"
BeginGroupIfNoSuchLine "GATEWAY=$(defaultrouter)"
DeleteLinesMatching "^GATEWAY.*"
Append "GATEWAY=$(defaultrouter)"
EndGroup
}
Yes, that makes sense. The info pages state:
`DefineClasses "CLASS1:CLASS2:..."'
Activate the following colon, comma or dot-separated list of
classes if and only if the file is edited.
The class " RestartNis" starts not only if i something changed in the
NISDOMAIN but either if the GATEWAY changes. The same thing happened if
i split it like that :
{ /etc/sysconfig/network
BeginGroupIfNoSuchLine "NISDOMAIN=$(domain)"
DeleteLinesMatching "^NISDOMAIN.*"
Append "NISDOMAIN=$(domain)"
EndGroup
DefineClasses "RestartNis"
}
{ /etc/sysconfig/network
BeginGroupIfNoSuchLine "GATEWAY=$(defaultrouter)"
DeleteLinesMatching "^GATEWAY.*"
Append "GATEWAY=$(defaultrouter)"
EndGroup
}
Cool, I didn't know that worked. It does exactly what the docs said
it would do. Namely define RestartNis if the file was edited by
Cfengine.