Skip to content
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

systemd instantiated services are not started when enabled via ignition #586

Closed
coreosbot opened this issue Nov 9, 2017 · 2 comments · Fixed by #934
Closed

systemd instantiated services are not started when enabled via ignition #586

coreosbot opened this issue Nov 9, 2017 · 2 comments · Fixed by #934
Labels

Comments

@coreosbot
Copy link
Contributor

Issue by @redbaron


Bug

Instantiated services can be enabled and return no error, but when machine boots, service is not enabled:

systemd:
  units:
    - name: [email protected]
      contents: |
        [Unit]
        Description=f
        [Service]
        Type=oneshot
        ExecStart=/bin/echo %i
        [Install]
        WantedBy=multi-user.target
    - name: [email protected]
      enable: true

then boot, see systemctl status [email protected] and it shows that it didn't start.

Container Linux Version

NAME="Container Linux by CoreOS"
ID=coreos
VERSION=1520.8.0
VERSION_ID=1520.8.0
BUILD_ID=2017-10-26-0342
PRETTY_NAME="Container Linux by CoreOS 1520.8.0 (Ladybug)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://issues.coreos.com"
COREOS_BOARD="amd64-usr"

Expected Behavior

Enabled service starts

Actual Behavior

Ingition uses systemd presets, which apparently does not support enabling instantiated services.
There is this discussion https://lists.freedesktop.org/archives/systemd-devel/2015-August/033834.html where hack with explicit symlinks installed via Alias= are used. Would be nice if Ignition took care of it

@peterbaouoft
Copy link

PR in systemd/systemd#9901

@dustymabe
Copy link
Member

picking up the conversation from systemd/systemd#9901 (comment)

@ajeddeloh
I'm not sure about how to approach adding support for this in Ignition itself. Probably via a compile time switch like "systemdversion=240" which lets us enable things only supported in 240+. We can't just enable it because then it will write out invalid files for anything that doesn't have systemd new enough.

Since at the point we are writing systemd unit files we have the real root mounted, can we check the version of systemd in the real root and act appropriately (i.e. at runtime).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants