Minikube: systemd-hostnamed service failed on startup

Created on 20 Oct 2016  ·  13Comments  ·  Source: kubernetes/minikube

_From @r2d4 on September 12, 2016 22:45_

Everything seems to be working fine, but systemd is reporting a degraded state because of the hostname service failing.

Is this a bug or limitation due to something else?

$ systemctl status systemd-hostnamed       
● systemd-hostnamed.service - Hostname Service
   Loaded: loaded (/lib/systemd/system/systemd-hostnamed.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2016-09-12 22:34:53 UTC; 6min ago
     Docs: man:systemd-hostnamed.service(8)
           man:hostname(5)
           man:machine-info(5)
           http://www.freedesktop.org/wiki/Software/systemd/hostnamed
  Process: 13423 ExecStart=/lib/systemd/systemd-hostnamed (code=exited, status=226/NAMESPACE)
 Main PID: 13423 (code=exited, status=226/NAMESPACE)

Sep 12 22:34:53 minikube systemd[1]: Starting Hostname Service...
Sep 12 22:34:53 minikube systemd[13423]: systemd-hostnamed.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-hostnamed: No such file or directory
Sep 12 22:34:53 minikube systemd[1]: systemd-hostnamed.service: Main process exited, code=exited, status=226/NAMESPACE
Sep 12 22:34:53 minikube systemd[1]: Failed to start Hostname Service.
Sep 12 22:34:53 minikube systemd[1]: systemd-hostnamed.service: Unit entered failed state.
Sep 12 22:34:53 minikube systemd[1]: systemd-hostnamed.service: Failed with result 'exit-code'.

_Copied from original issue: coreos/minikube-iso#10_

Most helpful comment

@CrescendoFang thanks for the hint! I'll experiment by modifying the provisioner to use hostnamectl instead.

All 13 comments

_From @jonboulle on September 13, 2016 12:17_

It's probably innocuous - I suppose we need to either disable the service or include the binary - @s-urbaniak ?

Thanks for reporting!

We don't really need this (we are setting the hostname using classical hostname [1]), but nevertheless it would be nice to have this working.

So /usr/lib/systemd/system/systemd-hostnamed.service points to the wrong location, it defines ExecStart=/lib/systemd/systemd-hostnamed rather than ExecStart=/usr/lib/systemd/systemd-hostnamed which is the correct location (and /usr/lib/systemd/systemd-hostnamed is present in the image.

I'll see why it generates the wrong ExecStart directive.

[1] https://github.com/kubernetes/minikube/blob/d74ce773cf9e6152c3bbe3bdde304e159f27ba44/vendor/github.com/docker/machine/libmachine/provision/generic.go#L41

I debugged a little more, it turns out, that systemd-hostnamed is started with PrivateTmp=true, causing the issue. I need to investigate this more.

bumping to next release, sorry, this needs more investigation.

_From @CrescendoFang on October 17, 2016 13:28_

I got same problem with Raspbian latest update:

● systemd-hostnamed.service - Hostname Service
Loaded: loaded (/lib/systemd/system/systemd-hostnamed.service; static)
Active: failed (Result: exit-code) since Mon 2016-10-17 20:19:47 WIB; 5min ago
Docs: man:systemd-hostnamed.service(8)
man:hostname(5)
man:machine-info(5)
http://www.freedesktop.org/wiki/Software/systemd/hostnamed
Process: 1064 ExecStart=/lib/systemd/systemd-hostnamed (code=exited, status=226/NAMESPACE)
Main PID: 1064 (code=exited, status=226/NAMESPACE)

got the solution: change the hostname once again via hostnamectl

@CrescendoFang thanks for the hint! I'll experiment by modifying the provisioner to use hostnamectl instead.

@s-urbaniak thanks for your issues!I can copy the good one to the bad one,it can be solved.

I can reproduce only on kvm, I have no trouble with VirtualBox.
If I changePrivateTmp=true in /usr/lib/systemd/system/systemd-hostnamed.service to false, all work with kvm.

Hey thanks for debugging, I think we can just add that option into the image

This seems to be working now:

systemctl status systemd-hostnamed
● systemd-hostnamed.service - Hostname Service
   Loaded: loaded (/lib/systemd/system/systemd-hostnamed.service; static; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-hostnamed.service(8)
           man:hostname(5)
           man:machine-info(5)
           http://www.freedesktop.org/wiki/Software/systemd/hostnamed

Guys, sorry, but what should I do to boot? (yes, I'm newbie) I've stuck with the message "Started Hostname Service" so I think this is the issue.
Yesterday I've got new updates on my Antergos and updated all that it asked. I'll not do updates in the future I guess -___-

UPDATE: I fugured out that It's not the topic related to my issue. Anyways, I've fixed boot issue in grub changed "gfxpayload=keep" to "gfxpayload=vga". Everything works for now :)

For those that need this, follow the steps below:

  1. systemctl edit systemd-hostnamed

    Add the 2 lines below then exit the editor (don't forget to save when prompted):

    [Service]
    PrivateNetwork=no

  2. This will create an override.conf file with the above 2 lines in the directory:

    /etc/systemd/system/systemd-hostnamed.service.d/

  3. The update systemd:

    systemctl daemon-reload

  4. Then restart the service:

    systemctl restart systemd-hostnamed

You should now be able to run hostnamectl without it hanging.

Was this page helpful?
0 / 5 - 0 ratings