RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1482800 - hostnamectl report "Could not set property: Connection timed out"
Summary: hostnamectl report "Could not set property: Connection timed out"
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-18 06:15 UTC by chen zhen
Modified: 2018-09-19 18:43 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-30 10:00:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description chen zhen 2017-08-18 06:15:55 UTC
Description of problem:


Version-Release number of selected component (if applicable):
systemd-sysv-219-30.el7_3.9.x86_64
systemd-219-30.el7_3.9.x86_64
systemd-libs-219-30.el7_3.9.x86_64

How reproducible:
70% 

Steps to Reproduce:
1.echo "hostnamectl set-hostname cloud-compute-1946.cloud.baby.cn >> /root/hostname.log 2>&1" >> /etc/rc.local
2. chmod +x /etc/rc.d/rc.local
3.reboot
4.it failed to set the hostname ,and cat /root/hostname.log:
Could not set property: Connection timed out

Actual results:
Failed to set hostname

Expected results:
Succeed in setting new hostname

Additional info:

Comment 2 Jan Synacek 2017-08-18 08:07:42 UTC
(In reply to chen zhen from comment #0)
> Steps to Reproduce:
> 1.echo "hostnamectl set-hostname cloud-compute-1946.cloud.baby.cn >>
> /root/hostname.log 2>&1" >> /etc/rc.local
> 2. chmod +x /etc/rc.d/rc.local
> 3.reboot

Why are you doing it like this? Please don't mix systemd's commands and initscripts like this. If you just do the "hostnamectl set-hostname cloud-compute-1946.cloud.baby.cn", then your hostname stays set, provided that nothing else set it elsewhere.

Comment 5 Jan Synacek 2018-07-30 10:00:10 UTC
This bugzilla complete escaped me, since it was last proposed for rhel-7.5. As I hinted in comment 2, it's a user error.

Comment 6 smanne 2018-09-19 18:43:09 UTC
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


Note You need to log in before you can comment on or make changes to this bug.