On 07/24/2012 01:23 PM, [email protected] wrote: > Forum: CFEngine Help > Subject: cfengine 3.3.4 sys.domain empty ??? > Author: stchesmeli > Link to topic: https://cfengine.com/forum/read.php?3,26600,26600#msg-26600 > > Hi all, since i upgrade to cfengine 3.3.4 (cfengine-community_3.3.4_amd64.deb > from this website) the variable "sys.domain" is empty. My update bundle use > this variable to automatically get the right files on mu hub server, so my > nodes get wrong files from the hub.... big disaster ! > I have made test: > > body common control > { > bundlesequence => { "test"}; > } > > bundle agent test > { > reports: > linux:: > "sys.arch value is ${sys.arch}"; > "sys.cdate value is ${sys.cdate}"; > "sys.cf_agent value is ${sys.cf_agent}"; > "sys.cf_execd value is ${sys.cf_execd}"; > "sys.cf_hub value is ${sys.cf_hub}"; > "sys.cf_key value is ${sys.cf_key}"; > "sys.domain value is ${sys.domain}"; > } > > Output: > > > R: sys.arch value is x86_64 > R: sys.cdate value is Tue_Jul_24_13_05_17_2012 > R: sys.cf_agent value is "/var/cfengine/bin/cf-agent" > R: sys.cf_execd value is "/var/cfengine/bin/cf-execd" > R: sys.cf_hub value is ${sys.cf_hub} > R: sys.cf_key value is "/var/cfengine/bin/cf-key" > R: sys.domain value is > > > So i roolback to 3.2.1 and everything is ok now. But, wow.... all my node get > bad files... is a bug ? Or do you have change something with the sys.domain > variable ? > > _______________________________________________
The domain code detection has been changed a lot between these versions.
I just tested it with 3.4.0 and my sys.domain variable is also empty. Do you
use FQDN for hostname? ,eg:
* gb-r2n1.irc.sara.nl
I just read the code and an empty string is copied into the domain variable if
you use the above syntax.
{{{
/* If hostname is qualified */
char *p = strchr(nodename, '.');
if (p != NULL)
{
strlcpy(uqname, nodename, MIN(CF_BUFSIZE, p - nodename + 1));
}
else
{
strcpy(uqname, nodename);
}
strcpy(domain, ""); <----- The error
}}}
I just set the hostname to short hostname:
* gb-r2n1
and everythings works as expected. So this is a bug!
--
********************************************************************
* Bas van der Vlies e-mail: [email protected] *
* SARA - Academic Computing Services Amsterdam, The Netherlands *
********************************************************************
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Help-cfengine mailing list [email protected] https://cfengine.org/mailman/listinfo/help-cfengine
