How to make docker.service wait for cni0.netdev bridge during systemd boot?
I'm running Ubuntu 18.04.1 LTS
I have created a cni0.netdev
and cni0.network
file in /etc/systemd/network
to create a virtual bridge to use for a local Kubernetes cluster/node.
I have enabled systemd-networkd-wait-online.service
I have the following in docker.service
[Unit]
:
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
Requires=docker.socket
However, when I start up, dockerd
complains that cni0
isn't yet up, yet when I log in, the bridge is there. If I restart dockerd
it picks up the bridge and uses it.
I can't add a After=
for cni0.netdev
because netdev
files are configuration files for systemd-networkd
and not "units" on their own.
It seems like systemd-networkd-wait-online.service
just waits for "any" interface to be online, which would be the regular eth0
interface.
How can I wait for this bridge to be up and configured before dockerd
is started?
systemd docker bridge systemd-networkd
add a comment |
I'm running Ubuntu 18.04.1 LTS
I have created a cni0.netdev
and cni0.network
file in /etc/systemd/network
to create a virtual bridge to use for a local Kubernetes cluster/node.
I have enabled systemd-networkd-wait-online.service
I have the following in docker.service
[Unit]
:
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
Requires=docker.socket
However, when I start up, dockerd
complains that cni0
isn't yet up, yet when I log in, the bridge is there. If I restart dockerd
it picks up the bridge and uses it.
I can't add a After=
for cni0.netdev
because netdev
files are configuration files for systemd-networkd
and not "units" on their own.
It seems like systemd-networkd-wait-online.service
just waits for "any" interface to be online, which would be the regular eth0
interface.
How can I wait for this bridge to be up and configured before dockerd
is started?
systemd docker bridge systemd-networkd
add a comment |
I'm running Ubuntu 18.04.1 LTS
I have created a cni0.netdev
and cni0.network
file in /etc/systemd/network
to create a virtual bridge to use for a local Kubernetes cluster/node.
I have enabled systemd-networkd-wait-online.service
I have the following in docker.service
[Unit]
:
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
Requires=docker.socket
However, when I start up, dockerd
complains that cni0
isn't yet up, yet when I log in, the bridge is there. If I restart dockerd
it picks up the bridge and uses it.
I can't add a After=
for cni0.netdev
because netdev
files are configuration files for systemd-networkd
and not "units" on their own.
It seems like systemd-networkd-wait-online.service
just waits for "any" interface to be online, which would be the regular eth0
interface.
How can I wait for this bridge to be up and configured before dockerd
is started?
systemd docker bridge systemd-networkd
I'm running Ubuntu 18.04.1 LTS
I have created a cni0.netdev
and cni0.network
file in /etc/systemd/network
to create a virtual bridge to use for a local Kubernetes cluster/node.
I have enabled systemd-networkd-wait-online.service
I have the following in docker.service
[Unit]
:
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
Requires=docker.socket
However, when I start up, dockerd
complains that cni0
isn't yet up, yet when I log in, the bridge is there. If I restart dockerd
it picks up the bridge and uses it.
I can't add a After=
for cni0.netdev
because netdev
files are configuration files for systemd-networkd
and not "units" on their own.
It seems like systemd-networkd-wait-online.service
just waits for "any" interface to be online, which would be the regular eth0
interface.
How can I wait for this bridge to be up and configured before dockerd
is started?
systemd docker bridge systemd-networkd
systemd docker bridge systemd-networkd
asked Jan 23 at 21:57
Jon WatteJon Watte
12325
12325
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can maybe try to add a After/Wants=sys-devices-virtual-net-cni0.device
You can check the exact name of the device using systemctl
OK, I should try that.
– Jon Watte
Jan 25 at 23:10
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f496335%2fhow-to-make-docker-service-wait-for-cni0-netdev-bridge-during-systemd-boot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can maybe try to add a After/Wants=sys-devices-virtual-net-cni0.device
You can check the exact name of the device using systemctl
OK, I should try that.
– Jon Watte
Jan 25 at 23:10
add a comment |
You can maybe try to add a After/Wants=sys-devices-virtual-net-cni0.device
You can check the exact name of the device using systemctl
OK, I should try that.
– Jon Watte
Jan 25 at 23:10
add a comment |
You can maybe try to add a After/Wants=sys-devices-virtual-net-cni0.device
You can check the exact name of the device using systemctl
You can maybe try to add a After/Wants=sys-devices-virtual-net-cni0.device
You can check the exact name of the device using systemctl
answered Jan 25 at 10:03
BigonBigon
1,257713
1,257713
OK, I should try that.
– Jon Watte
Jan 25 at 23:10
add a comment |
OK, I should try that.
– Jon Watte
Jan 25 at 23:10
OK, I should try that.
– Jon Watte
Jan 25 at 23:10
OK, I should try that.
– Jon Watte
Jan 25 at 23:10
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f496335%2fhow-to-make-docker-service-wait-for-cni0-netdev-bridge-during-systemd-boot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown