Red Hat Bugzilla – Bug 1501193
hostnamectl set-hostname not working - timeout
Last modified: 2018-09-19 14:44:16 EDT
Description of problem: [root@localhost ~]# hostnamectl set-hostname t-rhel75n1012 Could not set property: Message recipient disconnected from message bus without replying Version-Release number of selected component (if applicable): systemd-219-45.el7.x86_64 dbus-1.10.24-3.el7.x86_64 How reproducible: on 1 machine: 100% Steps to Reproduce: I installed a latest 7.5 nightly, in %post I used workaround for Bug 1500336 (see Bug 1500336#c7) Additional info: [root@localhost ~]# journalctl -perr -- Logs begin at Thu 2017-10-12 10:04:47 CEST, end at Thu 2017-10-12 10:24:47 CEST. -- Oct 12 10:04:47 localhost.localdomain kernel: ACPI PCC probe failed. Oct 12 08:04:56 localhost.localdomain systemd-hostnamed[649]: Failed to read hostname and machine information: Permission denied Oct 12 08:04:56 localhost.localdomain systemd[1]: Failed to start Hostname Service. Oct 12 10:05:12 localhost.localdomain systemd-hostnamed[3982]: Failed to read hostname and machine information: Permission denied Oct 12 10:15:02 localhost.localdomain systemd-hostnamed[11127]: Failed to read hostname and machine information: Permission denied Oct 12 10:16:09 localhost.localdomain systemd-hostnamed[11161]: Failed to read hostname and machine information: Permission denied Oct 12 10:18:48 localhost.localdomain systemd-hostnamed[11179]: Failed to read hostname and machine information: Permission denied Oct 12 10:24:47 localhost.localdomain systemd-hostnamed[11197]: Failed to read hostname and machine information: Permission denied [root@localhost ~]# systemctl status systemd-hostnamed ● systemd-hostnamed.service - Hostname Service Loaded: loaded (/usr/lib/systemd/system/systemd-hostnamed.service; static; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2017-10-12 10:24:47 CEST; 1min 15s ago Docs: man:systemd-hostnamed.service(8) man:hostname(5) man:machine-info(5) http://www.freedesktop.org/wiki/Software/systemd/hostnamed Process: 11197 ExecStart=/usr/lib/systemd/systemd-hostnamed (code=exited, status=1/FAILURE) Main PID: 11197 (code=exited, status=1/FAILURE) Oct 12 10:24:47 localhost.localdomain systemd[1]: Starting Hostname Service... Oct 12 10:24:47 localhost.localdomain systemd[1]: Started Hostname Service. Oct 12 10:24:47 localhost.localdomain systemd[1]: systemd-hostnamed.service: main process exited, code=exited, status=1/FAILURE Oct 12 10:24:47 localhost.localdomain systemd[1]: Unit systemd-hostnamed.service entered failed state. Oct 12 10:24:47 localhost.localdomain systemd[1]: systemd-hostnamed.service failed.
Missing executable bits on directory (and the directory should not be in lib64) drw-r--r--. 2 root root 118 12. říj 04.43 /usr/lib64/os.release.d
Folks, are you running that great tool from rel-eng called rpmdiff on your packages?
Default dir permissions for redhat-release are now set to 0755 Lubos
*** Bug 1507064 has been marked as a duplicate of this bug. ***
I was able to verify this bug on RHEL-7.5-20171130.0 with redhat-release-server-7.5-3.el7.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0700
Folks, these answers are not helpful and there are multiple other bugs opened for the same issue. Below is the fix that worked for me. from the below output of systemctl status command, I noticed that /tmp was not mounted with proper acls. sudo-sh[root@myhost]# hostnamectl set-hostname --static $dnsname Could not set property: Connection timed out sudo-sh[root@myhost]# hostnamectl set-hostname poc-rhel-cassandra-b1 Could not set property: Failed to activate service 'org.freedesktop.hostname1': timed out sudo-sh[root@myhost]# systemctl status systemd-hostnamed ● systemd-hostnamed.service - Hostname Service Loaded: loaded (/usr/lib/systemd/system/systemd-hostnamed.service; static; vendor preset: disabled) Active: inactive (dead) Docs: man:systemd-hostnamed.service(8) man:hostname(5) man:machine-info(5) http://www.freedesktop.org/wiki/Software/systemd/hostnamed Sep 19 13:52:53 myhost systemd[1]: Dependency failed for Hostname Service. Sep 19 13:52:53 myhost systemd[1]: Job systemd-hostnamed.service/start failed with result 'dependency'. Sep 19 13:54:02 myhost systemd[1]: Dependency failed for Hostname Service. Sep 19 13:54:02 myhost systemd[1]: Job systemd-hostnamed.service/start failed with result 'dependency'. Sep 19 13:55:18 myhost systemd[1]: Dependency failed for Hostname Service. Sep 19 13:55:18 myhost systemd[1]: Job systemd-hostnamed.service/start failed with result 'dependency'. sudo-sh[root@myhost]# systemctl restart systemd-hostnamed A dependency job for systemd-hostnamed.service failed. See 'journalctl -xe' for details. sudo-sh[root@myhost]# journalctl -xe -- Unit user-0.slice has finished shutting down. Sep 19 13:56:01 myhost systemd[1]: Stopping User Slice of root. -- Subject: Unit user-0.slice has begun shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit user-0.slice has begun shutting down. Sep 19 13:56:03 sudo-sh[12198]: ec2-user : HOST=myhost : TTY=pts/0 ; PWD=/home/ec2-user ; USER=root ; SUDO-SH-COMMAND=systemctl Sep 19 13:56:29 sudo-sh[12199]: ec2-user : HOST=myhost : TTY=pts/0 ; PWD=/home/ec2-user ; USER=root ; SUDO-SH-COMMAND=systemctl Sep 19 13:56:29 polkitd[624]: Registered Authentication Agent for unix-process:12199:22680 (system bus name :1.39 [/usr/bin/pkttyagent -- Sep 19 13:56:29 systemd[1]: Mounting /var/tmp... -- Subject: Unit var-tmp.mount has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit var-tmp.mount has begun starting up. Sep 19 13:56:29 mount[12205]: mount: /tmp is not a block device Sep 19 13:56:29 systemd[1]: var-tmp.mount mount process exited, code=exited status=32 Sep 19 13:56:29 systemd[1]: Failed to mount /var/tmp. -- Subject: Unit var-tmp.mount has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit var-tmp.mount has failed. -- -- The result is failed. Sep 19 13:56:29 systemd[1]: Dependency failed for Hostname Service. -- Subject: Unit systemd-hostnamed.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit systemd-hostnamed.service has failed. -- -- The result is dependency. Sep 19 13:56:29 systemd[1]: Job systemd-hostnamed.service/start failed with result 'dependency'. Sep 19 13:56:29 systemd[1]: Unit var-tmp.mount entered failed state. Sep 19 13:56:29 polkitd[624]: Unregistered Authentication Agent for unix-process:12199:22680 (system bus name :1.39, object path /org/fre Sep 19 13:56:36 sudo-sh[12207]: ec2-user : HOST=myhost : TTY=pts/0 ; PWD=/home/ec2-user ; USER=root ; SUDO-SH-COMMAND=journalctl to resolve this issue, I edited /etc/fstab and changed the /tmp acls. Before #/tmp /var/tmp auto rw,nodev,nofail,nosuid,relatime 0 0 After /tmp /var/tmp auto bind 0 0 make sure to make a copy of your original fstab file before editing, then restart the server. Now hostname service started fine. sudo-sh[root@myhost]# systemctl status systemd-hostnamed ● systemd-hostnamed.service - Hostname Service Loaded: loaded (/usr/lib/systemd/system/systemd-hostnamed.service; static; vendor preset: disabled) Active: inactive (dead) Docs: man:systemd-hostnamed.service(8) man:hostname(5) man:machine-info(5) http://www.freedesktop.org/wiki/Software/systemd/hostnamed Sep 19 14:16:45 systemd[1]: Starting Hostname Service... Sep 19 14:16:45 systemd[1]: Started Hostname Service. Also hostnamectl set-hostname command worked as expected. sudo-sh[root@myhost]# dnsname=`ifconfig eth0|grep netmask|awk '{print $2}'|while read addr; do host $addr|awk '{print $NF}'|sed 's/.$//'; done` sudo-sh[root@myhost]# hostnamectl set-hostname --static $dnsname sudo-sh[root@myhost]# hostnamectl status|grep Static Static hostname: poc-rhel-cassandra-b1