Skip to content

Commit

Permalink
Ignore modprobe failures in ExecStartPre (systemd unit)
Browse files Browse the repository at this point in the history
When running containerd inside LXC, due to systemd being unable to execute
`modprobe overlay` inside the container (module is already loaded in host kernel).

This patch adds a `-` prefix to the `ExecStartPre` command, so that failures
are ignored, and the service can start as usual.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Nov 10, 2018
1 parent 96d3078 commit 555ea3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion containerd.service
Expand Up @@ -4,7 +4,7 @@ Documentation=https://containerd.io
After=network.target

[Service]
ExecStartPre=/sbin/modprobe overlay
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/containerd

Delegate=yes
Expand Down
2 changes: 1 addition & 1 deletion docs/ops.md
Expand Up @@ -49,7 +49,7 @@ Documentation=https://containerd.io
After=network.target
[Service]
ExecStartPre=/sbin/modprobe overlay
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/containerd
Delegate=yes
KillMode=process
Expand Down

0 comments on commit 555ea3f

Please sign in to comment.