-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Rewrite syschdemd #126
Rewrite syschdemd #126
Conversation
, util-linux | ||
, defaultUser | ||
, automountPath | ||
, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
scripts/syschdemd.nix
Outdated
, | ||
}: | ||
let | ||
writeShellScript = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shadows a function in nixpkgs https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to mkWrappedScript
.
scripts/syschdemd.sh
Outdated
/bin/sh -c "cd \"$PWD\"; $exportCmd; source /etc/set-environment; exec $command" | ||
} | ||
|
||
main "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing final new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just reformatted the whole thing with shfmt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my interest: What settings are you using? Maybe we should document that somewhere to not reformat files multiple times. I am always using shfmt -ci -i 2 -s -w $FILE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did add it as a check in CI.
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
[ "${NIXOS_WSL_DEBUG:-}" == "1" ] && set -x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ "${NIXOS_WSL_DEBUG:-}" == "1" ] && set -x | |
[[ -v NIXOS_WSL_DEBUG ]] && set -x |
testing if it is set to anything maybe makes it easier if people accidentally use true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, applied.
596e8ba
to
e3b87ea
Compare
Docker Desktop is broken, because the |
Other than that, everything seems to be working |
I tried adding it to the outside script, can you see if that works? |
b4a504c
to
819b815
Compare
That does not seem to work. The volume shows up as an empty directory inside the container |
I am very confused by how the mounts work then. Can you run |
|
Is this from inside the namespace or outside? |
The command output is from inside the systemd namespace, but not the docker container. Outside the systemd namespace it looks like this: |
Can you try the latest commit? I think unshare was just doing a weird. |
Forgot to remove the other thing. Can you try it now? |
Mostly just a big pile of cleanups. Important changes: - refactor and clean up the code, fix all the shellcheck complaints - stop trying to guess paths in scripts and wrap them correctly instead - use nsfs instead of trying to figure out the right PID to copy namespaces from - clean up $WSLPATH to remove extra impure entries - don't try to restart systemd if it died - make sure the store is read-only before we do anything, so systemd can't mess with it - reformat shell scripts with shfmt
Squashed, should be good to go now. |
Mostly just a big pile of cleanups.
Important changes: