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.nspawn: fix missing suffix #27117

Merged
merged 1 commit into from
Apr 22, 2018
Merged

Conversation

cjxgm
Copy link

@cjxgm cjxgm commented Jul 4, 2017

Motivation for this change

Files placed in /etc/systemd/nspawn/ should have .nspawn suffix.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

CC @fpletz

Sorry, something went wrong.

Fix files placed in `/etc/systemd/nspawn/` missing `.nspawn` suffix
@Mic92
Copy link
Member

Mic92 commented Jul 4, 2017

Strange. I have an nspawn container and the extension is added:

$ cd /etc/systemd/nspawn
$ ls -la foo.nspawn
lrwxrwxrwx 1 root root 70 Jan  1  1970 foo.nspawn -> /nix/store/dxx5f1bd4gvkc5d3rmkc32v9xnfyp4x5-unit-foo.nspawn/foo.nspawn

what does it look like on your machine?

@cjxgm
Copy link
Author

cjxgm commented Jul 5, 2017

It looks like this on my machine:

root@nixarch /e/nixos# cd /etc/systemd/nspawn/
root@nixarch /n/s/b23dmksgmpcnxik1fs3lkxgsaxvgzmw8-nspawn-units# la
total 172K
dr-xr-xr-x   2 root root   4.0K Jan  1  1970 ./
drwxrwxr-t 407 root nixbld 164K Jul  5 18:48 ../
lrwxrwxrwx   1 root root     58 Jan  1  1970 arch -> /nix/store/hqd0b2jvv5s1s4w4162kjn2ny63fnpz1-unit-arch/arch

And with my patch applied:

root@nixarch ~/nixpkgs# nixos-rebuild switch -I nixpkgs=/root/nixpkgs
...
root@nixarch ~/nixpkgs# la /etc/systemd/nspawn/
total 176K
dr-xr-xr-x   2 root root   4.0K Jan  1  1970 ./
drwxrwxr-t 407 root nixbld 164K Jul  5 18:48 ../
lrwxrwxrwx   1 root root     72 Jan  1  1970 arch.nspawn -> /nix/store/387qy53vvz33db6h3r42q69k736fyy7q-unit-arch.nspawn/arch.nspawn

My configuration is:

{
  # ...
  systemd.nspawn.arch = {
    execConfig = {
      PrivateUsers = "no";
    };
  };
  # ...
}

@fpletz fpletz added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Jul 28, 2017
@matthewbauer
Copy link
Member

Looks harmless. Any objections to merging @Mic92?

@GrahamcOfBorg test systemd

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.systemd

Partial log (click to expand)

machine# [   11.104949] dhcpcd[771]: eth0: Router Advertisement from fe80::2
machine# [   11.106561] dhcpcd[771]: eth0: adding address fec0::5054:ff:fe12:3456/64
machine: exit status 0
2 out of 2 tests succeeded
test script finished in 34.33s
cleaning up
killing machine (pid 618)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/541i2wn959yjx94y54yyybiamrxvry7p-vm-test-run-systemd

@matthewbauer matthewbauer requested a review from Mic92 April 21, 2018 20:42
@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: tests.systemd

Partial log (click to expand)

cannot build derivation '/nix/store/7rs76yyzh3mk16szy62qisaw8vz4dmhh-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/6c4pwhsc261y2vs7zc0k9iffdvw34kw7-stage-1-init.sh.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/3rrynni5rxzzm09v3cr1yc400wiv744m-initrd.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/jilgjy09lckzrqnzcq82k20b7r6ipg4b-nixos-system-machine-18.09.git.abf05f1.drv': 5 dependencies couldn't be built
cannot build derivation '/nix/store/k4ay996c426yrg0xkan6azspj63m2vgb-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ajd69i5fc2il575j8d0xv8rz1mcc7ffp-run-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/21awjgl7mhpp7xq8sm62gnvv3djq2qmg-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/4mbjbzsjp3agpxjrlz33y5ag693lrai2-nixos-test-driver-systemd.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/y27v0cxmv4ijn359s6fv36ixg046fifa-vm-test-run-systemd.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/y27v0cxmv4ijn359s6fv36ixg046fifa-vm-test-run-systemd.drv' failed

@Mic92 Mic92 merged commit fecda34 into NixOS:master Apr 22, 2018
@Mic92
Copy link
Member

Mic92 commented Apr 22, 2018

18.03:
[detached HEAD 0517698] systemd.nspawn: fix missing suffix
Author: Giumo X. Clanjor (哆啦比猫/兰威举) cjxgm@126.com
Date: Tue Jul 4 21:12:47 2017 +0800
1 file changed, 1 insertion(+), 1 deletion(-)

@cjxgm cjxgm deleted the fix-nspawn-missing-suffix branch April 23, 2018 11:32
@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
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 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants