help-cfengine
[Top][All Lists]
Advanced

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

Re: How does cfagent determine the hostname?


From: John Borwick
Subject: Re: How does cfagent determine the hostname?
Date: Thu, 23 Sep 2004 10:53:49 -0400
User-agent: Mozilla Thunderbird 0.7.3 (X11/20040901)

John Borwick wrote:
Hello.

I'm trying to automate a machine installation with kickstart and cfengine. In my %post section, the last two lines are

hostname `hostname --fqdn`
cfagent -Kvq

This approach seems to work on RHAS2.1, but not RHEL3.

How should I set the hostname for cfagent?

Thanks, everyone, for all your help. I think the ". /etc/sysconfig/network" is especially neat. I ended up waiting to run cfengine until reboot, as follows (from kickstart file):

%post
# [...]
# FIRST BOOT
mv /etc/rc.d/rc.local /etc/rc.d/rc.local.sav
cat <<"RC_LOCAL" > /etc/rc.d/rc.local
#!/bin/sh
/usr/sbin/up2date --solvedeps=wfu-cfengine
mv /etc/rc.d/rc.local.sav /etc/rc.d/rc.local
RC_LOCAL
chmod 755 /etc/rc.d/rc.local


On first boot, /etc/rc.d/rc.local is evaluated as above. The RPM "wfu-cfengine" automatically runs "cfagent -Kvq" in *its* post section. (We have a RHN satellite server so we can upload our own RPMs to up2date, but a yum repository would work equally well.) rc.local then deletes itself by moving the original.

I did this because our cfengine setup runs some iptables stuff, and it's more convenient to run in the actual OS (with all modules, etc. set) than in the bare-bones kernel used by kickstart.

Yours,
John
--
           John Borwick
       System Administrator
      Wake Forest University | web  http://www.wfu.edu/~borwicjh
      Winston-Salem, NC, USA | GPG key ID             0x797326D5

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]