Thursday, January 31, 2008

Down yum! Down!

As reported previously, We discovered that the nightly yum update was enabled on the servers.

The magic cfengine snippet to disable this is:

# we don't want auto yum update stuff
nonightlyyum = ( `/usr/bin/test -f /var/lock/subsys/yum` )

"/sbin/chkconfig yum off" umask=022
"/sbin/service yum stop" umask=022

The same check-for-some-enabled-subsys trick can be used to disable many of the periodic checks run on a standard SL install. (it's what 'service foo status' does for many of them)

1 comment:

ChrisB said...

Another good way of checking whether a service is enabled is:

service_yum_on = ( ReturnsZero("/sbin/chkconfig --level 3 yum") )

since chkconfig returns 0 if the service is enabled at that level and 1 if it is not.