!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

284 Members
https://github.com/nix-community/NixOS-WSL55 Servers

Load older messages


SenderMessageTime
5 May 2024
@marie:marie.cologneMariemy logind somehow doesn't think i'm logged in, so my ssh agent user unit doesn't start. any ideas what could cause this?10:42:24
@k900:0upti.meK900
In reply to @nzbr:nzbr.de
https://github.com/nix-community/NixOS-WSL/pull/464
This possibly
10:45:42
@marie:marie.cologneMariecause or fix? it still doesn't work for me with that branch11:21:35
@nzbr:nzbr.denzbr (they/it)it doesn't seem to fix user systemd, but that seems to be broken on Ubuntu as well11:23:00
@man2dev:fedora.im@man2dev:fedora.im left the room.15:45:45
6 May 2024
@gleydar:beeper.comgleydarWeird, cause I have the emacs-server running via home-manger as a user-systemd service flawlessly11:19:34
@gleydar:beeper.comgleydar(in ubuntu)11:19:52
@gleydar:beeper.comgleydar * (in ubuntu) I'm on wsl version 2.2.3.011:20:31
@marie:marie.cologneMariei'm on 2.2.2.0 and it tells me there's no update :(13:01:27
@nzbr:nzbr.denzbr (they/it)
In reply to@gleydar:beeper.com
Weird, cause I have the emacs-server running via home-manger as a user-systemd service flawlessly
Just noticed that I get Failed to connect to bus: No such file or directory when running systemctl status without --user as well, so there's probably something broken with my Ubuntu install
(ps shows systemd as pid 1, so it is enabled)
14:18:06
@k900:0upti.meK900That sounds like your main dbus is dead 14:18:55
@nzbr:nzbr.denzbr (they/it)
In reply to@marie:marie.cologne
i'm on 2.2.2.0 and it tells me there's no update :(
Anything later than 2.1.5.0 is marked a pre-release on github. You can download and install them manually: https://github.com/microsoft/WSL/releases
I don't know what mechanism decides when they are availale through --update for you
14:20:54
@nzbr:nzbr.denzbr (they/it)
In reply to@k900:0upti.me
That sounds like your main dbus is dead
I tried restarting it, but that didn't help. I'll try with a fresh debian install I have lying around
14:21:39
@nzbr:nzbr.denzbr (they/it)Same problem14:33:35
@nzbr:nzbr.denzbr (they/it)I'll try a full reboot then14:33:45
@gleydar:beeper.comgleydarDamn, that sounds like a 💩 problem to debug14:35:23
@nzbr:nzbr.denzbr (they/it) Ok now sudo systemctl works, but sudo systemctl --user doesn't. Same thing on Ubuntu 14:39:12
@marie:marie.cologneMarie
In reply to @nzbr:nzbr.de
Just noticed that I get Failed to connect to bus: No such file or directory when running systemctl status without --user as well, so there's probably something broken with my Ubuntu install
(ps shows systemd as pid 1, so it is enabled)
is there any session running when you run loginctl
15:02:21
@marie:marie.cologneMariebecause thats not the case for me15:02:31
@nzbr:nzbr.denzbr (they/it)I went away from the laptop and put it on standby and now as I wanted to check loginctl, the session was there and it has magically fixed itself (on Ubuntu)17:41:57
@nzbr:nzbr.denzbr (they/it) On Debian it's still broken, but loginctl doesn't work either
nzbr@pulsar:~$ systemctl --user
Failed to connect to bus: No such file or directory
nzbr@pulsar:~$ sudo loginctl
Failed to connect to bus: No such file or directory
nzbr@pulsar:~$
17:43:30
8 May 2024
@nzbr:nzbr.denzbr (they/it) I can confirm that it is in fact the shell wrapper that is breaking user systemd. Interestingly WSL seems to only start login (and thus a session) once, with the first shell that is opened inside the distro. The shell that is connected to the terminal is not a child of that login process

[nixos@nixos:/mnt/d/Projekte/NixOS-WSL]$ ps -aef --forest
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  3 01:10 ?        00:00:00 /sbin/init
root           2       1  0 01:10 ?        00:00:00 /init
root           5       2  0 01:10 ?        00:00:00  \_ plan9 --control-socket 6 --log-level 4 --server-fd 7 --pipe-fd 9 --log-truncate
root         279       2  0 01:10 ?        00:00:00  \_ /init
root         280     279  0 01:10 ?        00:00:00  |   \_ /init
nixos        281     280  0 01:10 pts/0    00:00:00  |       \_ -bash
nixos        308     281  0 01:10 pts/0    00:00:00  |           \_ ps -aef --forest
root         282       2  0 01:10 pts/1    00:00:00  \_ /bin/login -f
nixos        299     282  0 01:10 pts/1    00:00:00      \_ -bash
root          90       1  0 01:10 ?        00:00:00 /nix/store/hacx6zmpap5vcqa2bbl2gqlmdc7bi3vg-systemd-254.10/lib/systemd/systemd-journald
root         120       1  0 01:10 ?        00:00:00 /nix/store/hacx6zmpap5vcqa2bbl2gqlmdc7bi3vg-systemd-254.10/lib/systemd/systemd-udevd
systemd+     247       1  0 01:10 ?        00:00:00 /nix/store/hacx6zmpap5vcqa2bbl2gqlmdc7bi3vg-systemd-254.10/lib/systemd/systemd-timesyncd
nscd         251       1  0 01:10 ?        00:00:00 /nix/store/h6njfdbw5i38jlaldhbp5f3xw96f8c8s-nsncd-unstable-2023-10-26/bin/nsncd
message+     261       1  0 01:10 ?        00:00:00 /nix/store/3s47g2m09pnbyqvpp821glb7yyrvdc3v-dbus-1.14.10/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root         272       1  0 01:10 ?        00:00:00 /nix/store/hacx6zmpap5vcqa2bbl2gqlmdc7bi3vg-systemd-254.10/lib/systemd/systemd-logind
nixos        288       1  0 01:10 ?        00:00:00 /nix/store/hacx6zmpap5vcqa2bbl2gqlmdc7bi3vg-systemd-254.10/lib/systemd/systemd --user
nixos        289     288  0 01:10 ?        00:00:00  \_ (sd-pam)

When a second shell is started, it is the child of a completely separate tree started by /init. The login process and the bash that is a child of it remain running
(I'm not putting the second ps output here for space reasons)
01:13:25
@nzbr:nzbr.denzbr (they/it) Made it write the error message to a file in /tmp on crashes and this is what I get
when reading /etc/set-environment

Caused by:
    No child processes (os error 10)

The easy workaround would be to sleep forever if the parent process is a login whose parent is /init, but I'd rather have it just start the shell correctly
02:22:11
@nzbr:nzbr.denzbr (they/it) Turns out the process gets set up to ignore SIGCHLD, which makes the wrapper crash when it tries to wait for the sh it forks off to parse /etc/set-environment. The wrapper now checks if SIGCHLD is ignored and skips setting the environment if that is the case. That makes systemctl --user work again 03:23:54
@k900:0upti.meK900Oh dear lord04:43:51
@k900:0upti.meK900So cursed04:43:57
@k900:0upti.meK900 nzbr (they/it): nix has a sigaction wrapper btw 04:46:09
@k900:0upti.meK900https://docs.rs/nix/latest/nix/sys/signal/fn.sigaction.html04:46:10
@k900:0upti.meK900Oh I see it doesn't do null05:15:41
@balanced_design:matrix.orgbalanced_design joined the room.13:57:58

Show newer messages


Back to Room ListRoom Version: 9