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>
(cherry picked from commit 555ea3f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Nov 10, 2018
1 parent b337430 commit 36d2576
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion containerd.service
Original file line number Diff line number Diff line change
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
KillMode=process
Expand Down
2 changes: 1 addition & 1 deletion docs/ops.md
Original file line number Diff line number Diff line change
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 36d2576

Please sign in to comment.