Bug 1501193
Summary: | hostnamectl set-hostname not working - timeout | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Marian Csontos <mcsontos> |
Component: | redhat-release | Assignee: | Lubos Kocman <lkocman> |
Status: | CLOSED ERRATA | QA Contact: | Release Test Team <release-test-team-automation> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.5 | CC: | arydekul, chaitu2k6, dtodorov, jlinton, jstodola, pkotvan, ssbarnea, systemd-maint-list |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | redhat-release-7.5-0.8.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-10 10:17:23 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Marian Csontos
2017-10-12 08:28:54 UTC
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 I faced this problem recently and my /etc/fstab didn't had any entry for /tmp, just the main xfs partition. I am almost sure that setting hostname worked before on the same host and I suspect some recent change may have introduced this issue. I want to prevent reachign this case again and run some preparatory ansible task(s) before set-hostname is called but I am afraid that touching /etc/fstab may be too dangereus especially as user may have added some other custom /tmp config. Any ideas detect-and-fix scriptable approach? I hit what looks to be using the same origin pattern as described in this bug. It just comes down to a SElinux issue. In my case it was: [root@satellite2 ~]# hostnamectl set-hostname satellite2.dc2.example.com Could not set property: Message recipient disconnected from message bus without replying [root@satellite2 ~]# restorecon /etc/machine-info [root@satellite2 ~]# hostnamectl set-hostname satellite2.dc2.example.com [root@satellite2 ~]# hostname satellite2.dc2.example.com [root@satellite2 ~]# uname -a Linux satellite2.dc2.example.com 3.10.0-957.5.1.el7.x86_64 #1 SMP Wed Dec 19 10:46:58 EST 2018 x86_64 x86_64 x86_64 GNU/Linux [root@satellite2 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.6 (Maipo) [root@satellite2 ~]# I dont really think its an issue in RHEL 7.6 as such, but this is a freshly installed VM from a kickstarted RHEL minimal with very little modifications (as stock as possible). But, it has had virt-sysprep run on it. |