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

virtualisation-xen: Fix xendomains startup #25257

Merged
merged 1 commit into from Apr 27, 2017
Merged

Conversation

michalpalka
Copy link

  • Revert to using bash, not sh for the xendomains script to avoid syntax error
  • Rewrite /bin/ls to ls in the xendomains script
Motivation for this change

Currently, the xendomains service fails to start the xen VMs, failing with the error:

Apr 27 07:26:28 nixos xendomains[844]: /nix/store/naf65vhayfc1dcsm2w4qxdvy8953kbh3-xen-4.5.5/lib/xen/bin/xendomains: line 141: syntax error near unexpected token `<'
Apr 27 07:26:28 nixos xendomains[844]: /nix/store/naf65vhayfc1dcsm2w4qxdvy8953kbh3-xen-4.5.5/lib/xen/bin/xendomains: line 141: `        if test -z "$RUNLEVEL"; then read RUNLEVEL RE
Apr 27 07:26:28 nixos systemd[1]: xen-domains.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

The reason for this is that the xendomains script expects to be run using bash, but the build script rewrites its shebang line to point at sh:

find . -type f | xargs sed -i 's@/bin/bash@/bin/sh@g'

Additionally, the script would fail because of trying to run /bin/ls.

This pull request fixes both problems.

Please note that /bin/ls was already being substituted by ls before commit 9e6ae2f was applied. That commit removed a number of other substitutions, which might need to be revisited.

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 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.

* Revert to using bash, not sh for the xendomains script to avoid syntax error
* Rewrite /bin/ls to ls in the xendomains script
@mention-bot
Copy link

@michalpalka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @oxij, @edolstra and @7c6f434c to be potential reviewers.

@7c6f434c 7c6f434c merged commit 29d8271 into NixOS:master Apr 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants