← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1662542] [NEW] Rhel7 set_hostname not working due to cyclic dependency

 

Public bug reported:

Using version 0.7.9
Cloud-init.service fails setting the hostname on a rhel7 with the error

  ProcessExecutionError: Unexpected error while running command.
  Command: ['hostnamectl', 'set-hostname', 'foo']
  Exit code: 1
  Reason: -
  Stdout: -
  Stderr: Failed to create bus connection: No such file or directory

The issue seems to be, that the rhel distro file is implementing
set_hostname via hostnamectl, which requires systemd-hostnamed.service
to be running (as far as I could figure out).

Now the default cloud-init.service is configured with
   Before=sysinit.target
But the systemd-hostenamed.service uses the default dependencies, which means it is started after sysinit.target.

If I add "Requires=Requires=systemd-hostnamed.service" to cloud-
init.service, of course I get the following on "systemd-analyze verify
cloud-init.service":

systemd-analyze verify /var/lib/systemd/system/cloud-init.service
Found ordering cycle on sysinit.target/start
Found dependency on cloud-init.service/start
Found dependency on systemd-hostnamed.service/start
Found dependency on basic.target/start
Found dependency on sysinit.target/start
Unable to break cycle
Requested transaction contains an unfixable cyclic ordering dependency: Transaction order is cyclic. See system logs for details.
Error: org.freedesktop.systemd1.TransactionOrderIsCyclic: Transaction order is cyclic. See system logs for details.
Failed to create cloud-init.service/start: Resource deadlock avoided

** Affects: cloud-init
     Importance: Undecided
         Status: New

** Description changed:

+ Using version 0.7.9
  Cloud-init.service fails setting the hostname on a rhel7 with the error
  
-   ProcessExecutionError: Unexpected error while running command.
-   Command: ['hostnamectl', 'set-hostname', 'foo']
-   Exit code: 1
-   Reason: -
-   Stdout: -
-   Stderr: Failed to create bus connection: No such file or directory
+   ProcessExecutionError: Unexpected error while running command.
+   Command: ['hostnamectl', 'set-hostname', 'foo']
+   Exit code: 1
+   Reason: -
+   Stdout: -
+   Stderr: Failed to create bus connection: No such file or directory
  
  The issue seems to be, that the rhel distro file is implementing
  set_hostname via hostnamectl, which requires systemd-hostnamed.service
  to be running (as far as I could figure out).
  
- Now the default cloud-init.service is configured with 
-    Before=sysinit.target
- But the systemd-hostenamed.service uses the default dependencies, which means it is started after sysinit.target. 
+ Now the default cloud-init.service is configured with
+    Before=sysinit.target
+ But the systemd-hostenamed.service uses the default dependencies, which means it is started after sysinit.target.
  
  If I add "Requires=Requires=systemd-hostnamed.service" to cloud-
  init.service, of course I get the following on "systemd-analyze verify
  cloud-init.service":
  
  systemd-analyze verify /var/lib/systemd/system/cloud-init.service
  Found ordering cycle on sysinit.target/start
  Found dependency on cloud-init.service/start
  Found dependency on systemd-hostnamed.service/start
  Found dependency on basic.target/start
  Found dependency on sysinit.target/start
  Unable to break cycle
  Requested transaction contains an unfixable cyclic ordering dependency: Transaction order is cyclic. See system logs for details.
  Error: org.freedesktop.systemd1.TransactionOrderIsCyclic: Transaction order is cyclic. See system logs for details.
  Failed to create cloud-init.service/start: Resource deadlock avoided

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1662542

Title:
  Rhel7 set_hostname not working due to cyclic dependency

Status in cloud-init:
  New

Bug description:
  Using version 0.7.9
  Cloud-init.service fails setting the hostname on a rhel7 with the error

    ProcessExecutionError: Unexpected error while running command.
    Command: ['hostnamectl', 'set-hostname', 'foo']
    Exit code: 1
    Reason: -
    Stdout: -
    Stderr: Failed to create bus connection: No such file or directory

  The issue seems to be, that the rhel distro file is implementing
  set_hostname via hostnamectl, which requires systemd-hostnamed.service
  to be running (as far as I could figure out).

  Now the default cloud-init.service is configured with
     Before=sysinit.target
  But the systemd-hostenamed.service uses the default dependencies, which means it is started after sysinit.target.

  If I add "Requires=Requires=systemd-hostnamed.service" to cloud-
  init.service, of course I get the following on "systemd-analyze verify
  cloud-init.service":

  systemd-analyze verify /var/lib/systemd/system/cloud-init.service
  Found ordering cycle on sysinit.target/start
  Found dependency on cloud-init.service/start
  Found dependency on systemd-hostnamed.service/start
  Found dependency on basic.target/start
  Found dependency on sysinit.target/start
  Unable to break cycle
  Requested transaction contains an unfixable cyclic ordering dependency: Transaction order is cyclic. See system logs for details.
  Error: org.freedesktop.systemd1.TransactionOrderIsCyclic: Transaction order is cyclic. See system logs for details.
  Failed to create cloud-init.service/start: Resource deadlock avoided

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1662542/+subscriptions


Follow ups