New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker is not enabling with ignition #2079

Closed
tiukhtinvladimir opened this Issue Jul 28, 2017 · 14 comments

Comments

Projects
None yet
5 participants
@tiukhtinvladimir

tiukhtinvladimir commented Jul 28, 2017

Bug

Using ignition I do enabled: true on docker service, but when OS is booted docker service is not actually enabled.

localhost ~ # systemctl is-enabled docker
linked

This behavior I am observing only with docker service, because var-lib-docker.mount for example works pretty good

Container Linux Version

localhost ~ # cat /etc/os-release 
NAME="Container Linux by CoreOS"
ID=coreos
VERSION=1478.0.0
VERSION_ID=1478.0.0
BUILD_ID=2017-07-19-0038
PRETTY_NAME="Container Linux by CoreOS 1478.0.0 (Ladybug)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://issues.coreos.com"
COREOS_BOARD="amd64-usr"

Environment

Container Linux is run under QEMU/KVM with PXE boot and ignition config

Expected Behavior

docker service enabled and running

Actual Behavior

docker service is not enabled and not running

Reproduction Steps

Do config like:

  "systemd": {
    "units": [
      {
       	"name": "var-lib-docker.mount",
        "enabled": true,
        "contents": "[Unit]\nDescription=Mount ephemeral to /var/lib/docker\n\n[Mount]\nWhat=/dev/disk/by-label/docker_storage\nWhere=/var/lib/docker\nType=ext4\n[Install]\nWantedBy=local-fs.target\n"
      },
      {
       	"name": "docker.service",
        "enabled": true,
        "dropins": [
          {
            "name": "20-aditional_options.conf",
            "contents": "[Service]\nEnvironment=DOCKER_OPTS='--storage-driver=overlay2 --log-driver=journald'"
          }
	]
      }
    ]
  },

and reboot your guest

@lucab

This comment has been minimized.

Show comment
Hide comment
@lucab

lucab Jul 28, 2017

Member

Which ignition config schema are you using? enabled didn't exist in 2.0.0.

Member

lucab commented Jul 28, 2017

Which ignition config schema are you using? enabled didn't exist in 2.0.0.

@crawford

This comment has been minimized.

Show comment
Hide comment
@crawford

crawford Jul 28, 2017

Member

You are also trying to enable from a drop-in, which won't work. You can use the online validator to check your config.

Member

crawford commented Jul 28, 2017

You are also trying to enable from a drop-in, which won't work. You can use the online validator to check your config.

@tiukhtinvladimir

This comment has been minimized.

Show comment
Hide comment
@tiukhtinvladimir

tiukhtinvladimir Jul 28, 2017

Hello @lucab. I am using 2.1.0. I guess it could be somehow related to TORCX, because docker unit exists only in /run/torcx path....

Hello @lucab. I am using 2.1.0. I guess it could be somehow related to TORCX, because docker unit exists only in /run/torcx path....

@tiukhtinvladimir

This comment has been minimized.

Show comment
Hide comment
@tiukhtinvladimir

tiukhtinvladimir Jul 28, 2017

Hello @crawford. No, it was a typo, I've updated config above

tiukhtinvladimir commented Jul 28, 2017

Hello @crawford. No, it was a typo, I've updated config above

@crawford

This comment has been minimized.

Show comment
Hide comment
@crawford

crawford Jul 28, 2017

Member

@tiukhtinvladimir Can you attach the Ignition logs? journalctl -b -t ignition --no-pager

Member

crawford commented Jul 28, 2017

@tiukhtinvladimir Can you attach the Ignition logs? journalctl -b -t ignition --no-pager

@tiukhtinvladimir

This comment has been minimized.

Show comment
Hide comment
@tiukhtinvladimir

tiukhtinvladimir Jul 28, 2017

Sure

localhost ~ # journalctl -b -t ignition --no-pager
-- Logs begin at Fri 2017-07-28 15:10:39 UTC, end at Fri 2017-07-28 16:05:37 UTC. --
Jul 28 15:10:39 localhost ignition[237]: Ignition v0.17.1
Jul 28 15:10:39 localhost ignition[237]: parsed url from cmdline: "http://192.168.101.200/configs/coreos.cfg"
Jul 28 15:10:39 localhost ignition[237]: GET http://192.168.101.200/configs/coreos.cfg: attempt #1
Jul 28 15:10:39 localhost ignition[237]: GET error: Get http://192.168.101.200/configs/coreos.cfg: dial tcp 192.168.101.200:80: connect: network is unreachable
Jul 28 15:10:40 localhost ignition[237]: GET http://192.168.101.200/configs/coreos.cfg: attempt #2
Jul 28 15:10:40 localhost ignition[237]: GET error: Get http://192.168.101.200/configs/coreos.cfg: dial tcp 192.168.101.200:80: connect: network is unreachable
Jul 28 15:10:40 localhost ignition[237]: GET http://192.168.101.200/configs/coreos.cfg: attempt #3
Jul 28 15:10:40 localhost ignition[237]: GET error: Get http://192.168.101.200/configs/coreos.cfg: dial tcp 192.168.101.200:80: connect: network is unreachable
Jul 28 15:10:41 localhost ignition[237]: GET http://192.168.101.200/configs/coreos.cfg: attempt #4
Jul 28 15:10:41 localhost ignition[237]: GET result: OK
Jul 28 15:10:41 localhost ignition[237]: parsing config: {
                                           "ignition": {
                                             "version": "2.1.0",
                                             "config": {}
                                           },
                                           "storage": {
                                             "filesystems": [
                                               {
                                                 "name": "docker_storage",
                                                 "mount": {
                                                   "device": "/dev/vda",
                                                   "format": "ext4",
                                                   "wipeFilesystem": false,
                                                   "label": "docker_storage"
                                                   }
                                               }
                                             ]
                                           },
                                           "systemd": {
                                             "units": [
                                               {
                                                 "name": "var-lib-docker.mount",
                                                 "enabled": true,
                                                 "contents": "[Unit]\nDescription=Mount ephemeral to /var/lib/docker\n\n[Mount]\nWhat=/dev/disk/by-label/docker_storage\nWhere=/var/lib/docker\nType=ext4\n[Install]\nWantedBy=local-fs.target\n"
                                               },
                                               {
                                                 "name": "docker.service",
                                                 "enabled": true,
                                                 "dropins": [
                                                   {
                                                     "name": "20-aditional_options.conf",
                                                     "contents": "[Service]\nEnvironment=DOCKER_OPTS='--storage-driver=overlay2 --log-driver=journald'"
                                                   }
                                                 ]
                                               }
                                             ]
                                           },
                                           "networkd": {},
                                           "passwd": {
                                             "users": [
                                               {
                                                 "name": "vladimir.tiukhtin",
                                                 "sshAuthorizedKeys": [
                                                   "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC9IO4dAE0rFOctD72U0eXD4TRzzo9o4FfgXFjcBQhzN1Lbz0t6ZpV8c1/fk8vL33yWhLQYfTPGXWjJ5ilPHykWahoSQUBLywCaC7AFz2PS3jNiE/IrTFd5WEXl9/VO3uiSHG/gf8Q9evGs+neF16HMRA8RQOT3NqMHPJJZNbHHYQ== vladimir.tiukhtin@asergis.com"
                                                 ],
                                                 "groups": [ "sudo", "docker" ]
                                               }
                                             ]
                                           }
                                         }
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(1): [started]  waiting for devices [/dev/vda]
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(1): [finished] waiting for devices [/dev/vda]
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: created device alias for "/dev/vda": "/dev_aliases/dev/vda" -> "/dev/vda"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(2): [started]  determining filesystem type of "/dev/vda"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(2): found ext4 filesystem at "/dev/vda" with uuid "ad0e742b-cc5f-465d-845a-0906c3731a70" and label "docker_storage"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(2): [finished] determining filesystem type of "/dev/vda"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: filesystem at "/dev/vda" is already formatted. Skipping mkfs...
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(3): [started]  waiting for udev to settle
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(3): executing: "/bin/udevadm" "settle"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(3): [finished] waiting for udev to settle
Jul 28 15:10:41 localhost ignition[342]: Ignition v0.17.1
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(1): [started]  checking if user "vladimir.tiukhtin" exists
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(1): executing: "chroot" "/sysroot" "id" "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(1): [failed]   checking if user "vladimir.tiukhtin" exists: exit status 1: Cmd: "chroot" "/sysroot" "id" "vladimir.tiukhtin" Stdout: "" Stderr: "id: 'vladimir.tiukhtin': no such user\n"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(2): [started]  creating or modifying user "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(2): executing: "useradd" "--root" "/sysroot" "--create-home" "--password" "*" "--groups" "sudo,docker" "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(2): [finished] creating or modifying user "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(3): [started]  adding ssh keys to user "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(3): [finished] adding ssh keys to user "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: op(4): [started]  processing unit "var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(4): op(5): [started]  writing unit "var-lib-docker.mount" at "etc/systemd/system/var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(4): op(5): [finished] writing unit "var-lib-docker.mount" at "etc/systemd/system/var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(4): [finished] processing unit "var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(6): [started]  enabling unit "var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(6): [finished] enabling unit "var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(7): [started]  processing unit "docker.service"
Jul 28 15:10:41 localhost ignition[342]: files: op(7): op(8): [started]  writing drop-in "20-aditional_options.conf" at "etc/systemd/system/docker.service.d/20-aditional_options.conf"
Jul 28 15:10:41 localhost ignition[342]: files: op(7): op(8): [finished] writing drop-in "20-aditional_options.conf" at "etc/systemd/system/docker.service.d/20-aditional_options.conf"
Jul 28 15:10:41 localhost ignition[342]: files: op(7): [finished] processing unit "docker.service"
Jul 28 15:10:41 localhost ignition[342]: files: op(9): [started]  enabling unit "docker.service"
Jul 28 15:10:41 localhost ignition[342]: files: op(9): [finished] enabling unit "docker.service"
localhost ~ # ls -l /lib/systemd/system/docker.service
ls: cannot access '/lib/systemd/system/docker.service': No such file or directory
localhost ~ # ls -l /lib/systemd/system/docker.socket 
ls: cannot access '/lib/systemd/system/docker.socket': No such file or directory
localhost ~ # ls -l /run/torcx/unpack/docker/lib/systemd/system/ 
total 12
-rw-r--r--. 1 root root  739 Jul 19 00:30 containerd.service
-rw-r--r--. 1 root root 1600 Jul 19 00:30 docker.service
-rw-r--r--. 1 root root  239 Jul 19 00:30 docker.socket
drwxr-xr-x. 2 root root   60 Jul 28 15:10 sockets.target.wants

tiukhtinvladimir commented Jul 28, 2017

Sure

localhost ~ # journalctl -b -t ignition --no-pager
-- Logs begin at Fri 2017-07-28 15:10:39 UTC, end at Fri 2017-07-28 16:05:37 UTC. --
Jul 28 15:10:39 localhost ignition[237]: Ignition v0.17.1
Jul 28 15:10:39 localhost ignition[237]: parsed url from cmdline: "http://192.168.101.200/configs/coreos.cfg"
Jul 28 15:10:39 localhost ignition[237]: GET http://192.168.101.200/configs/coreos.cfg: attempt #1
Jul 28 15:10:39 localhost ignition[237]: GET error: Get http://192.168.101.200/configs/coreos.cfg: dial tcp 192.168.101.200:80: connect: network is unreachable
Jul 28 15:10:40 localhost ignition[237]: GET http://192.168.101.200/configs/coreos.cfg: attempt #2
Jul 28 15:10:40 localhost ignition[237]: GET error: Get http://192.168.101.200/configs/coreos.cfg: dial tcp 192.168.101.200:80: connect: network is unreachable
Jul 28 15:10:40 localhost ignition[237]: GET http://192.168.101.200/configs/coreos.cfg: attempt #3
Jul 28 15:10:40 localhost ignition[237]: GET error: Get http://192.168.101.200/configs/coreos.cfg: dial tcp 192.168.101.200:80: connect: network is unreachable
Jul 28 15:10:41 localhost ignition[237]: GET http://192.168.101.200/configs/coreos.cfg: attempt #4
Jul 28 15:10:41 localhost ignition[237]: GET result: OK
Jul 28 15:10:41 localhost ignition[237]: parsing config: {
                                           "ignition": {
                                             "version": "2.1.0",
                                             "config": {}
                                           },
                                           "storage": {
                                             "filesystems": [
                                               {
                                                 "name": "docker_storage",
                                                 "mount": {
                                                   "device": "/dev/vda",
                                                   "format": "ext4",
                                                   "wipeFilesystem": false,
                                                   "label": "docker_storage"
                                                   }
                                               }
                                             ]
                                           },
                                           "systemd": {
                                             "units": [
                                               {
                                                 "name": "var-lib-docker.mount",
                                                 "enabled": true,
                                                 "contents": "[Unit]\nDescription=Mount ephemeral to /var/lib/docker\n\n[Mount]\nWhat=/dev/disk/by-label/docker_storage\nWhere=/var/lib/docker\nType=ext4\n[Install]\nWantedBy=local-fs.target\n"
                                               },
                                               {
                                                 "name": "docker.service",
                                                 "enabled": true,
                                                 "dropins": [
                                                   {
                                                     "name": "20-aditional_options.conf",
                                                     "contents": "[Service]\nEnvironment=DOCKER_OPTS='--storage-driver=overlay2 --log-driver=journald'"
                                                   }
                                                 ]
                                               }
                                             ]
                                           },
                                           "networkd": {},
                                           "passwd": {
                                             "users": [
                                               {
                                                 "name": "vladimir.tiukhtin",
                                                 "sshAuthorizedKeys": [
                                                   "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC9IO4dAE0rFOctD72U0eXD4TRzzo9o4FfgXFjcBQhzN1Lbz0t6ZpV8c1/fk8vL33yWhLQYfTPGXWjJ5ilPHykWahoSQUBLywCaC7AFz2PS3jNiE/IrTFd5WEXl9/VO3uiSHG/gf8Q9evGs+neF16HMRA8RQOT3NqMHPJJZNbHHYQ== vladimir.tiukhtin@asergis.com"
                                                 ],
                                                 "groups": [ "sudo", "docker" ]
                                               }
                                             ]
                                           }
                                         }
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(1): [started]  waiting for devices [/dev/vda]
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(1): [finished] waiting for devices [/dev/vda]
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: created device alias for "/dev/vda": "/dev_aliases/dev/vda" -> "/dev/vda"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(2): [started]  determining filesystem type of "/dev/vda"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(2): found ext4 filesystem at "/dev/vda" with uuid "ad0e742b-cc5f-465d-845a-0906c3731a70" and label "docker_storage"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(2): [finished] determining filesystem type of "/dev/vda"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: filesystem at "/dev/vda" is already formatted. Skipping mkfs...
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(3): [started]  waiting for udev to settle
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(3): executing: "/bin/udevadm" "settle"
Jul 28 15:10:41 localhost ignition[237]: disks: createFilesystems: op(3): [finished] waiting for udev to settle
Jul 28 15:10:41 localhost ignition[342]: Ignition v0.17.1
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(1): [started]  checking if user "vladimir.tiukhtin" exists
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(1): executing: "chroot" "/sysroot" "id" "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(1): [failed]   checking if user "vladimir.tiukhtin" exists: exit status 1: Cmd: "chroot" "/sysroot" "id" "vladimir.tiukhtin" Stdout: "" Stderr: "id: 'vladimir.tiukhtin': no such user\n"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(2): [started]  creating or modifying user "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(2): executing: "useradd" "--root" "/sysroot" "--create-home" "--password" "*" "--groups" "sudo,docker" "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(2): [finished] creating or modifying user "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(3): [started]  adding ssh keys to user "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: createUsers: op(3): [finished] adding ssh keys to user "vladimir.tiukhtin"
Jul 28 15:10:41 localhost ignition[342]: files: op(4): [started]  processing unit "var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(4): op(5): [started]  writing unit "var-lib-docker.mount" at "etc/systemd/system/var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(4): op(5): [finished] writing unit "var-lib-docker.mount" at "etc/systemd/system/var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(4): [finished] processing unit "var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(6): [started]  enabling unit "var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(6): [finished] enabling unit "var-lib-docker.mount"
Jul 28 15:10:41 localhost ignition[342]: files: op(7): [started]  processing unit "docker.service"
Jul 28 15:10:41 localhost ignition[342]: files: op(7): op(8): [started]  writing drop-in "20-aditional_options.conf" at "etc/systemd/system/docker.service.d/20-aditional_options.conf"
Jul 28 15:10:41 localhost ignition[342]: files: op(7): op(8): [finished] writing drop-in "20-aditional_options.conf" at "etc/systemd/system/docker.service.d/20-aditional_options.conf"
Jul 28 15:10:41 localhost ignition[342]: files: op(7): [finished] processing unit "docker.service"
Jul 28 15:10:41 localhost ignition[342]: files: op(9): [started]  enabling unit "docker.service"
Jul 28 15:10:41 localhost ignition[342]: files: op(9): [finished] enabling unit "docker.service"
localhost ~ # ls -l /lib/systemd/system/docker.service
ls: cannot access '/lib/systemd/system/docker.service': No such file or directory
localhost ~ # ls -l /lib/systemd/system/docker.socket 
ls: cannot access '/lib/systemd/system/docker.socket': No such file or directory
localhost ~ # ls -l /run/torcx/unpack/docker/lib/systemd/system/ 
total 12
-rw-r--r--. 1 root root  739 Jul 19 00:30 containerd.service
-rw-r--r--. 1 root root 1600 Jul 19 00:30 docker.service
-rw-r--r--. 1 root root  239 Jul 19 00:30 docker.socket
drwxr-xr-x. 2 root root   60 Jul 28 15:10 sockets.target.wants
@lucab

This comment has been minimized.

Show comment
Hide comment
@lucab

lucab Jul 28, 2017

Member

I managed to reproduce this on current alpha&beta but not on stable, so it may possibly be related to the torcxified docker unit.

The problem is that the preset has no effect as the multi-user.target.wants entry is not created. This may be related to the fact that those runtime units are symlinks, and the preset may be considering them as aliases and skipping them (while it shouldn't).

I'm also seeing some oddities when doing a manual systemctl enable docker, so I think that in general systemd is getting confused by the symlinks.

Member

lucab commented Jul 28, 2017

I managed to reproduce this on current alpha&beta but not on stable, so it may possibly be related to the torcxified docker unit.

The problem is that the preset has no effect as the multi-user.target.wants entry is not created. This may be related to the fact that those runtime units are symlinks, and the preset may be considering them as aliases and skipping them (while it shouldn't).

I'm also seeing some oddities when doing a manual systemctl enable docker, so I think that in general systemd is getting confused by the symlinks.

@tiukhtinvladimir

This comment has been minimized.

Show comment
Hide comment
@tiukhtinvladimir

tiukhtinvladimir Jul 28, 2017

Also, I cannot find utils:

localhost ~ # which torcx
which: no torcx in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/bin)
localhost ~ # which ignition
which: no ignition in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/bin)

tiukhtinvladimir commented Jul 28, 2017

Also, I cannot find utils:

localhost ~ # which torcx
which: no torcx in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/bin)
localhost ~ # which ignition
which: no ignition in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/bin)
@lucab

This comment has been minimized.

Show comment
Hide comment
@lucab

lucab Jul 28, 2017

Member

@tiukhtinvladimir torcx is a systemd-generator and ignition is an initrd service, you won't find them in your PATH.

Member

lucab commented Jul 28, 2017

@tiukhtinvladimir torcx is a systemd-generator and ignition is an initrd service, you won't find them in your PATH.

lucab added a commit to lucab/torcx that referenced this issue Jul 31, 2017

pkg: propagate units via files
This changes the propagation logic for packaged systemd units by copying
runtime units instead of symlinking them.

Reference: coreos/bugs#2079

lucab added a commit to lucab/torcx that referenced this issue Aug 1, 2017

pkg: propagate units via files
This changes the propagation logic for packaged systemd units by copying
runtime units instead of symlinking them.

Reference: coreos/bugs#2079
@euank

This comment has been minimized.

Show comment
Hide comment
@euank

euank Aug 1, 2017

Contributor

I think this issue has two parts and we've only fixed one part actually. I tried to write a regresison test for this, but it still fails with the torcx change (test here: euank/mantle@692976e#diff-240792ccb6cb7404909ff89e812fe4ccR28).

I verified that the preset file was created with enable docker.service, and manually running systemctl preset docker does enable it.. I suspect that presets are being run before torcx's generator runs. It seems confusing that presets can't interact appropriately with generated units, so maybe this is a systemd bug.

Contributor

euank commented Aug 1, 2017

I think this issue has two parts and we've only fixed one part actually. I tried to write a regresison test for this, but it still fails with the torcx change (test here: euank/mantle@692976e#diff-240792ccb6cb7404909ff89e812fe4ccR28).

I verified that the preset file was created with enable docker.service, and manually running systemctl preset docker does enable it.. I suspect that presets are being run before torcx's generator runs. It seems confusing that presets can't interact appropriately with generated units, so maybe this is a systemd bug.

@euank euank reopened this Aug 1, 2017

@lucab

This comment has been minimized.

Show comment
Hide comment
@lucab

lucab Aug 1, 2017

Member

Ah, I tested this manually so I didn't realize. Yes, it looks like presets are applied in main() while generator are run later in Manager. I think the ordering here is quite forced by the fact that presets need to be applied before /etc/machine-id is written, while generators are re-run at every daemon-reload. Not sure what we can propose here to improve the situation.

Member

lucab commented Aug 1, 2017

Ah, I tested this manually so I didn't realize. Yes, it looks like presets are applied in main() while generator are run later in Manager. I think the ordering here is quite forced by the fact that presets need to be applied before /etc/machine-id is written, while generators are re-run at every daemon-reload. Not sure what we can propose here to improve the situation.

@euank

This comment has been minimized.

Show comment
Hide comment
@euank

euank Aug 1, 2017

Contributor

Why do presets need to be applied before machine-id? Doesn't systemd recall for ConditionFirstBoot whether it created machine-id or not?

Anyways, I haven't tested, but it seems possible that ignition writing a ConditionFirstBoot unit which runs after generators and invokes systemctl preset-all might work?

Contributor

euank commented Aug 1, 2017

Why do presets need to be applied before machine-id? Doesn't systemd recall for ConditionFirstBoot whether it created machine-id or not?

Anyways, I haven't tested, but it seems possible that ignition writing a ConditionFirstBoot unit which runs after generators and invokes systemctl preset-all might work?

@lucab

This comment has been minimized.

Show comment
Hide comment
@lucab

lucab Aug 7, 2017

Member

@euank ack, fixed upstream. Backports:

Member

lucab commented Aug 7, 2017

@euank ack, fixed upstream. Backports:

@dm0-

This comment has been minimized.

Show comment
Hide comment
@dm0-

dm0- Aug 9, 2017

Member

The fixes are applied and will be in the next releases.

Member

dm0- commented Aug 9, 2017

The fixes are applied and will be in the next releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment