-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
nixos-container: support restarts #39717
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GrahamcOfBorg
added
6.topic: nixos
Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
10.rebuild-darwin: 0
This PR does not cause any packages to rebuild
10.rebuild-linux: 1-10
labels
Apr 30, 2018
Success on x86_64-linux (full log) Attempted: nixos-container Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: nixos-container Partial log (click to expand)
|
The |
Much thanks! |
I don't foresee any issues with this, so I'll go ahead an merge it. |
danbst
added a commit
to danbst/nixpkgs
that referenced
this pull request
Feb 15, 2020
Fixes NixOS#43652 Fixes NixOS#16753 Alternative fix for NixOS#39717 The fix in NixOS#76719 was not enough `--keep-unit` ties systemd-nspawn container to systemd unit. When unit is restarted (ie atomic operation "restart", not two separate "stop" and "start") systemd assumes that unit didn't disappear. Hence machine won't disappear. If unit is stopped (or stopped due to failure), associated machine is also stopped, so service can start fresh. Resource slice isn't changed though - it is machine.slice by default for nspawn containers.
zhaofengli
pushed a commit
to zhaofengli/nixpkgs
that referenced
this pull request
Mar 10, 2021
Fixes NixOS#43652 Fixes NixOS#16753 Alternative fix for NixOS#39717 The fix in NixOS#76719 was not enough `--keep-unit` ties systemd-nspawn container to systemd unit. When unit is restarted (ie atomic operation "restart", not two separate "stop" and "start") systemd assumes that unit didn't disappear. Hence machine won't disappear. If unit is stopped (or stopped due to failure), associated machine is also stopped, so service can start fresh. Resource slice isn't changed though - it is machine.slice by default for nspawn containers.
zhaofengli
pushed a commit
to mars-research/nixpkgs
that referenced
this pull request
Apr 14, 2021
Fixes NixOS#43652 Fixes NixOS#16753 Alternative fix for NixOS#39717 The fix in NixOS#76719 was not enough `--keep-unit` ties systemd-nspawn container to systemd unit. When unit is restarted (ie atomic operation "restart", not two separate "stop" and "start") systemd assumes that unit didn't disappear. Hence machine won't disappear. If unit is stopped (or stopped due to failure), associated machine is also stopped, so service can start fresh. Resource slice isn't changed though - it is machine.slice by default for nspawn containers.
zhaofengli
pushed a commit
to zhaofengli/nixpkgs
that referenced
this pull request
Apr 30, 2021
Fixes NixOS#43652 Fixes NixOS#16753 Alternative fix for NixOS#39717 The fix in NixOS#76719 was not enough `--keep-unit` ties systemd-nspawn container to systemd unit. When unit is restarted (ie atomic operation "restart", not two separate "stop" and "start") systemd assumes that unit didn't disappear. Hence machine won't disappear. If unit is stopped (or stopped due to failure), associated machine is also stopped, so service can start fresh. Resource slice isn't changed though - it is machine.slice by default for nspawn containers.
12 tasks
donovanglover
added a commit
to donovanglover/nixpkgs
that referenced
this pull request
Jul 20, 2023
The original pull request didn't add `restart` to the list of available commands. See: NixOS#39717
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
6.topic: nixos
Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
10.rebuild-darwin: 0
This PR does not cause any packages to rebuild
10.rebuild-linux: 1-10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
I wanted to be able to restart a container.
Running the nixos/tests/container* tests doesn't complete as containers-restart_networking.nix fails but it also fails without this change.
Cc @globin @nh2
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)