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

user-runtime-dir unit fails to start #158

Closed
tinloaf opened this issue Apr 27, 2021 · 6 comments
Closed

user-runtime-dir unit fails to start #158

tinloaf opened this issue Apr 27, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@tinloaf
Copy link

tinloaf commented Apr 27, 2021

Windows version (build number):
20H2 (Build 19042.928)

Linux distribution:
Ubuntu Focal

Genie version:
1.39

Describe the bug
The [email protected] unit fails to start. I see this error in the journal:

Apr 27 08:59:50 LBA-DB-21-wsl systemd[1]: Failed to start User Runtime Directory /run/user/1000.
Apr 27 08:59:50 LBA-DB-21-wsl systemd[1]: [email protected]: Failed with result 'exit-code'.
Apr 27 08:59:50 LBA-DB-21-wsl systemd[1]: [email protected]: Main process exited, code=exited, status=32/n/a
Apr 27 08:59:50 LBA-DB-21-wsl mount[748]: mount: /run/user/1000: special device /mnt/wslg/runtime-dir does not exist.
Apr 27 08:59:50 LBA-DB-21-wsl systemd-logind[289]: New session c1 of user lba.
Apr 27 08:59:50 LBA-DB-21-wsl systemd[1]: Starting User Runtime Directory /run/user/1000...
Apr 27 08:59:50 LBA-DB-21-wsl systemd[1]: Created slice User Slice of UID 1000.

Indeed, the directory /mnt/wslg does not exist. I can see that genie does install an override for user-runtime-dir that mounts /run/user/1000 into /mnt/wslg, but I can't figure out where /mnt/wslg is supposed to come from.

If the bug involves systemctl or a service running under systemd, confirm that you are running inside the bottle:
"inside"

To Reproduce
Just start the bottle (e.g. wsl -- genie -s)

Expected behavior
The service should start. :)

@tinloaf tinloaf added the bug Something isn't working label Apr 27, 2021
@a-m-s
Copy link

a-m-s commented Apr 27, 2021

I'm seeing this for user 128:

Failed units will now be displayed (systemctl list-units --failed):
  UNIT                         LOAD   ACTIVE SUB    DESCRIPTION
● [email protected] loaded failed failed User Runtime Directory /run/user/128

Same error message about /mnt/wslg/runtime-dir.

@cerebrate
Copy link
Member

Both of these errors are unforeseen issues with WSLg support. They'll be fixed in 1.40, releasing later today.

@cerebrate
Copy link
Member

And now done.

@tinloaf
Copy link
Author

tinloaf commented Apr 28, 2021

Thanks! However, I think there is still a problem with the start order. This is what I see in my log after starting genie. My systemd's user session fails to start:

> journalctl -ru [email protected]
-- Logs begin at Wed 2021-02-17 09:43:30 CET, end at Wed 2021-04-28 09:01:53 CEST. --
Apr 28 09:00:15 LBA-DB-21-wsl systemd[1]: Failed to start User Manager for UID 1000.
Apr 28 09:00:15 LBA-DB-21-wsl systemd[1]: [email protected]: Failed with result 'exit-code'.
Apr 28 09:00:15 LBA-DB-21-wsl systemd[1]: [email protected]: Main process exited, code=exited, status=219/CGROUP
Apr 28 09:00:15 LBA-DB-21-wsl systemd[1]: Starting User Manager for UID 1000...
Apr 28 08:55:27 LBA-DB-21-wsl systemd[1]: Failed to start User Manager for UID 1000.
Apr 28 08:55:27 LBA-DB-21-wsl systemd[1]: [email protected]: Failed with result 'exit-code'.
Apr 28 08:55:27 LBA-DB-21-wsl systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Apr 28 08:55:27 LBA-DB-21-wsl systemd[472]: Trying to run as user instance, but $XDG_RUNTIME_DIR is not set.
Apr 28 08:55:27 LBA-DB-21-wsl systemd[472]: pam_systemd(systemd-user:session): Not setting $XDG_RUNTIME_DIR, as the directory is not in order.
Apr 28 08:55:27 LBA-DB-21-wsl systemd[472]: pam_systemd(systemd-user:session): Runtime directory '/run/user/1000' is not owned by UID 1000, as it should.
Apr 28 08:55:27 LBA-DB-21-wsl systemd[472]: pam_unix(systemd-user:session): session opened for user lba by (uid=0)
Apr 28 08:55:27 LBA-DB-21-wsl systemd[1]: Starting User Manager for UID 1000...
Apr 28 08:54:18 LBA-DB-21-wsl systemd[1]: [email protected]: Job [email protected]/start failed with result 'dependency'.
Apr 28 08:54:18 LBA-DB-21-wsl systemd[1]: Dependency failed for User Manager for UID 1000.
Apr 28 08:50:58 LBA-DB-21-wsl systemd[1]: [email protected]: Job [email protected]/start failed with result 'dependency'.
Apr 28 08:50:58 LBA-DB-21-wsl systemd[1]: Dependency failed for User Manager for UID 1000.

However, the directory looks fine:

root@LBA-DB-21-wsl:/home/lba# ls -l /run/user/
total 0
drwx------ 3 lba lba 60 Apr 28 09:00 1000

And if I just run systemctl restart [email protected], the user session comes up successfully. My guess it that systemd tries to start [email protected] before the directory is mounted?

@cerebrate
Copy link
Member

What does a systemctl status on [email protected] look like?

@tinloaf
Copy link
Author

tinloaf commented Apr 28, 2021

I can't reproduce the problem anymore, not even after wsl -t. I'm not sure if there's a race condition somewhere or if this was a one-time glitch. If it happens again, I'll try to get as much logs and status outputs as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants