Skip to content

machinectl start fails with hyphens in machine name #3788

@svvac

Description

@svvac

Submission type

Bug report

Environment

# systemctl --version
systemd 230
+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN
# hostnamectl
   Static hostname: my-hostname
         Icon name: computer-server
           Chassis: server
        Machine ID: <machine ID>
           Boot ID: <boot ID>
  Operating System: Arch Linux
            Kernel: Linux 4.6.4-1-ARCH
      Architecture: x86-64

Setup

I have serveral machines (Btrfs subvolumes, but I don't suspect it changes anything) in /var/lib/machines

# ls /var/lib/machines
base-arch
base-arch.20160723
arch-test-1
test1

All subvolumes are snapshots of each other, so we expect the same behaviour in all cases.

Expected behaviour

# machinectl start base-arch
# machinectl start base-arch.20160723
# machinectl start arch-test-1
# machinectl start test1

Unexpected behaviour

# machinectl start base-arch
Job for systemd-nspawn@base\x2darch.service failed because the control process exited with error code.
See "systemctl status systemd-nspawn@base\x2darch.service" and "journalctl -xe" for details.
# machinectl start base-arch.20160723
Job for systemd-nspawn@base\x2darch.20160723.service failed because the control process exited with error code.
See "systemctl status systemd-nspawn@base\x2darch.20160723.service" and "journalctl -xe" for details.
# machinectl start arch-test-1
Job for systemd-nspawn@arch\x2dtest\x2d1.service failed because the control process exited with error code.
See "systemctl status systemd-nspawn@arch\x2dtest\x2d1.service" and "journalctl -xe" for details.
# machinectl start test1   # This one actually succeeds

When attempting to start a machine with a dash in its name, machinectl fails to bring it up. systemctl start systemd-nspawn@arch-test-1 (with actual dashes, and not \x2d) works as expected though. When no dashes are present, there are no issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions