-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
fix(syschdemd): exit code #140
Conversation
No, they're spawning a shell as a child of /init, so it's not even in the right slice. |
I wanted to find out, how distrod gets around that, and the answer seems to be that they didn't:
|
genie seems to use machinectl |
A possible solution would be to use machinectl when launching the default shell and systemd-run when a command is specified. I'd rather find a way to always use systemd-run though |
@K900 We might be able to use the same approach (using |
@nzbr what do you think about adding me as a collaborator to this repo? |
Starts now without crashing. ssh-agent is still broken because of systemctl status diff between before and after this PR: I think TERMINFO_DIRS is set wrong by wezterm. Otherwise things seem to work. --- before 2022-11-11 18:06:50.116889800 +0100
+++ after 2022-11-11 18:07:26.142133500 +0100
@@ -2,28 +2,47 @@
State: running
Jobs: 0 queued
Failed: 0 units
- Since: Fri 2022-11-11 18:06:28 CET; 22s ago
+ Since: Fri 2022-11-11 18:07:19 CET; 6s ago
CGroup: /
├─user.slice
│ └─user-1000.slice
│ ├─user@1000.service
│ │ ├─app.slice
│ │ │ ├─ssh-agent.service
- │ │ │ │ └─ 70 /nix/store/hfmwjjkz0c2p9ggcqw22rgnhx0jjm84z-openssh-9.1p1/bin/ssh-agent -a /run/user/1000/ssh-agent
+ │ │ │ │ └─ 69 /nix/store/hfmwjjkz0c2p9ggcqw22rgnhx0jjm84z-openssh-9.1p1/bin/ssh-agent -a /run/user/1000/ssh-agent
│ │ │ └─auto-fix-vscode-server.service
│ │ │ ├─ 63 /nix/store/y0g1mvsr6vygr61f9znljik9kl0x0inc-bash-5.1-p16/bin/bash /nix/store/ngx73rfq5mx9s4zkgjjnypciizq4n7aa-auto-fix-vscode-server.sh
- │ │ │ ├─ 116 /nix/store/y0g1mvsr6vygr61f9znljik9kl0x0inc-bash-5.1-p16/bin/bash /nix/store/ngx73rfq5mx9s4zkgjjnypciizq4n7aa-auto-fix-vscode-server.sh
- │ │ │ └─ 117 inotifywait -q -m -e CREATE,ISDIR -e DELETE_SELF --format %w%f:%e /home/sandro/.vscode-server/bin
+ │ │ │ ├─ 118 /nix/store/y0g1mvsr6vygr61f9znljik9kl0x0inc-bash-5.1-p16/bin/bash /nix/store/ngx73rfq5mx9s4zkgjjnypciizq4n7aa-auto-fix-vscode-server.sh
+ │ │ │ └─ 119 inotifywait -q -m -e CREATE,ISDIR -e DELETE_SELF --format %w%f:%e /home/sandro/.vscode-server/bin
│ │ └─init.scope
│ │ ├─ 56 /nix/store/isg9b516rmlf6ri8c29jm9ibl1kg0sa7-systemd-249.12/lib/systemd/systemd --user
│ │ └─ 57 (sd-pam)
│ └─session-c1.scope
- │ ├─ 54 /run/current-system/sw/bin/bash
- │ ├─ 68 (sd-pam)
- │ ├─ 93 /nix/store/4wnc0503iawwc2166jfwkf0zmd7wr0ps-cod-0.1.0/bin/cod api forked-daemon 87
+ │ ├─ 54 /nix/store/15y79343wxnalk8629v9vg63a31pbwk7-util-linux-2.38.1-bin/bin/runuser -u sandro -- /bin/sh -c declare -x COLORTERM="truecolor"
+declare -x DISPLAY=":0"
+declare -x HOSTTYPE="x86_64"
+declare -x LANG="en_US.UTF-8"
+declare -x NAME="francium"
+declare -x OLDPWD
+declare -x PATH="/run/wrappers/bin:/nix/store/xq4g38m5ppg78z7bzfxyy2s8ii693k74-coreutils-9.1/bin:/nix/store/vdmbj6w77pg29fn77ndn659ngbxjsq4w-daemonize-1.7.8/bin:/nix/store/4xynblhic6sq4paq2ra4ql535yyvracs-glibc-2.35-163-bin/bin:/nix/store/sqypvzmrsl8hil564xfk8n5w51gq47h0-gnugrep-3.7/bin:/nix/store/z5qg6m93yv2wsij772rsljah3ahw1m8b-systemd-251.5/bin:/nix/store/15y79343wxnalk8629v9vg63a31pbwk7-util-linux-2.38.1-bin/bin:/nix/store/ldaflixlmv5dills5dq960i6m1s9pzq0-which-2.21/bin:/nix/store/53ssjlp0w2dsbifdg9jbykypq05205c2-nixos-wsl-systemd-wrapper/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib"
+declare -x PULSE_SERVER="/mnt/wslg/PulseServer"
+declare -x PWD="/mnt/c/Users/user"
+declare -x SHLVL="1"
+declare -x TERM="wezterm"
+declare -x TERMINFO_DIRS="/home/user/.nix-profile/share/terminfo"
+declare -x TERM_PROGRAM="WezTerm"
+declare -x TERM_PROGRAM_VERSION="20220905-102802-7d4b8249"
+declare -x WAYLAND_DISPLAY="wayland-0"
+declare -x WSL2_GUI_APPS_ENABLED="1"
+declare -x WSLENV="TERMINFO_DIRS:TERM:COLORTERM:TERM_PROGRAM:TERM_PROGRAM_VERSION"
+declare -x WSL_DISTRO_NAME="NixOS"
+declare -x WSL_INTEROP="/run/WSL/6_interop"
+declare -x XDG_RUNTIME_DIR="/mnt/wslg/runtime-dir"; source /etc/set-environment; exec /run/current-system/sw/bin/bash
+ │ ├─ 67 /run/current-system/sw/bin/bash
+ │ ├─ 93 /nix/store/4wnc0503iawwc2166jfwkf0zmd7wr0ps-cod-0.1.0/bin/cod api forked-daemon 86
│ ├─ 131 /run/current-system/sw/bin/bash
- │ ├─ 134 /nix/store/5ysxr04vk1v2arpyl6brd0xzlig5sds8-gitstatus-1.5.4/bin/gitstatusd -G v1.5.4 --parent-pid=54 --num-threads=8 --max-num-staged=1 --max-num-unstaged=1 --max-num-conflicted=1 --max-num-untracked=1 --dirty-max-index-size=-1 --repo-ttl-seconds=3600
- │ └─ 348 systemctl status
+ │ ├─ 134 /nix/store/5ysxr04vk1v2arpyl6brd0xzlig5sds8-gitstatus-1.5.4/bin/gitstatusd -G v1.5.4 --parent-pid=67 --num-threads=8 --max-num-staged=1 --max-num-unstaged=1 --max-num-conflicted=1 --max-num-untracked=1 --dirty-max-index-size=-1 --repo-ttl-seconds=3600
+ │ └─ 237 systemctl status
├─init.scope
│ └─ 1 systemd
└─system.slice |
git gpg signing is broken with those changes. Not sure why and I am not looking forward to debugging it. |
I don't have |
No, but I hoped it would work now. Let me debug that this later. |
* upstream/main: Fix syschdemd exit code (nix-community#140) update remaining references to wsl.automountPath (nix-community#158) Update flakes (nix-community#124) wsl.conf: proper option types (nix-community#153) Fix eval by disabling module completely when wsl.enable = false (nix-community#151) NixOS users.users.<user> attribute name and .name can differ (nix-community#147) switch nixpkgs.overlays to inline overlay (nix-community#150) feat: native systemd support (nix-community#134) remove boot.isContainer (nix-community#145) Do not import minimal profile by default (nix-community#144)
This fixes #138, by using systemd-run instead of machinectl, but breaks systemd user sessions and dbus
@K900: If we can get those to work with systemd-run, it will probably work with native systemd as well (because I think this is what MS is using as well)