Re: Weird sys.fqhost value

"'Robert Markula' via help-cfengine" <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
Hi Bas,

thanks for trying to reproduce the error. The host is running on Ubuntu 
20.04. If I downgrade to Cfengine 15.2, then sys.fqhost is working 
correctly. As soon as I upgrade to Cfengine 18.2 or above, the error 
appears. There is no change on the configuration or the masterfiles between 
upgrading/downgrading.

<snip>
root@test1:~# *cat /etc/hosts*
127.0.0.1    localhost
127.0.1.1    test1.example.com test1

::1        localhost ip6-localhost ip6-loopback
ff02::1        ip6-allnodes
ff02::2        ip6-allrouters

root@test1:~# *cat /etc/hostname *
test1

root@test1:~# *cat /proc/sys/kernel/hostname*
test1

root@test1:~# *echo $HOSTNAME*
test1
</snip>

I have absolutely no idea where redundant space characters are coming from. 
This is so weird.
Bas van der Vlies schrieb am Freitag, 23. September 2022 um 11:03:35 UTC+2:

> Hi Robert,
>
> On which OS?
> I have done dome tests and I also rely on this variable. But on our 
> machines I do not see this weird behaviour.
>
> You can check:
> ```
> /etc/hosts for networking
> /etc/hostname : This will be read by boot scripts on boot time and 
> set its value.
> /proc/sys/kernel/hostname : Current hostname.
> /etc/sysconfig/network : Networking (HOSTNAME=”server1″ parameter)
> ```
>
> maybe there is some weird character somewehere
>
>
>
> On 23/09/2022 10:37, 'Robert Markula' via help-cfengine wrote:
> > Greetings everyone,
> > 
> > Since the upgrade from Cfengine 3.15 to 3.18 I can observe a weird 
> > '*sys.fqhost*' value.
> > 
> > In 3.15.2 this variable is correct:
> > default:sys.fqhost                       test1.example.com 
> >                              inventory,source=agent,attribute_name=Host 
> > name
> > 
> > In 3.18.2 and 3.20.0 however, there are numerous spaces around the 
> hostname:
> > default:sys.fqhost 
> > 
> > 
> > 
> > 
> > 
> > 
> >                                           test1. 
> > 
> > 
> > 
> > 
> > 
> > 
> >                                              example.com 
> > inventory,source=agent,attribute_name=Host name
> > default:sys.uqhost                       test1 
> >                              inventory,source=agent,attribute_name=none
> > default:sys.domain                       example.com 
> >                              source=agent
> > 
> > Note the many spaces between the hostname and the domain name.
> > 
> > Accordingly, cf-exec fails to run with his message in /var/log/syslog:
> > error: Couldn't open 
> > 
> '/var/cfengine/outputs/cf___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________test1_____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________example_com__1663916430_Fri_Sep_23_09_00_30_2022_0x7ff5fa880b80' 
> - aborting exec. (fopen: File name too long)
> > 
> > 'hostname -f' gives:
> > test1.example.com
> > 
> > root@test1:~# hostname
> > test1
> > 
> > And in the body common control in promises.cf I have set:
> > body common control
> > {
> > [...]
> > domain => "example.com";
> > [...]
> > }
> > 
> > And, for completeness sake:
> > root@test1:~# cat /etc/hosts
> > 127.0.0.1    localhost
> > 127.0.1.1    test1.example.com test1
> > 
> > ::1        localhost ip6-localhost ip6-loopback
> > ff02::1        ip6-allnodes
> > ff02::2        ip6-allrouters
> > 
> > root@test1:~# cat /etc/hostname
> > test1
> > 
> > So I have absolutely no idea where these spaces are coming from. Any 
> ideas?
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "help-cfengine" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to [email protected] 
> > <mailto:[email protected]>.
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/help-cfengine/4dc4492a-d42a-4610-a9df-ad15dd0a36dcn%40googlegroups.com 
> <
> https://groups.google.com/d/msgid/help-cfengine/4dc4492a-d42a-4610-a9df-ad15dd0a36dcn%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
>
> -- 
> --
> Bas van der Vlies
> | High Performance Computing & Visualization | SURF| Science Park 140 | 
> 1098 XG Amsterdam
> | T +31 (0) 20 800 1300 <+31%2020%20800%201300> | [email protected] | 
> www.surf.nl |
>

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/2964882d-b48a-4219-bb8b-967e0725f5den%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.