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

test-login fails in a chroot #45

Closed
kensington opened this Issue Jan 31, 2018 · 11 comments

Comments

Projects
None yet
2 participants
@kensington
Copy link
Collaborator

kensington commented Jan 31, 2018

When building elogind in a chroot, test-login failed:

78/83 test-login                              FAIL     0.07 s

--- command ---
PATH='/var/tmp/portage/sys-auth/elogind-235.2-r1/work/elogind-235.2-build:/usr/lib/portage/python3.5/ebuild-helpers/xattr:/usr/lib/portage/python3.5/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/7.2.0:/usr/lib/llvm/5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin' /var/tmp/portage/sys-auth/elogind-235.2-r1/work/elogind-235.2-build/test-login
--- stderr ---
/* Information printed is from the live system */
sd_pid_get_slice(0, …) → "sshd"
sd_pid_get_session(0, …) → "sshd"
Assertion 'sd_pid_get_owner_uid(0, &u2) == 0' failed at ../elogind-235.2/src/libelogind/sd-login/test-login.c:86, function test_login(). Aborting.
@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented Jan 31, 2018

@kensington could you please provide the content of /proc/self/cgroup please? Instead of a session id, sd_pid_get_slice() returns "sshd", that's odd...

@kensington

This comment has been minimized.

Copy link
Collaborator Author

kensington commented Feb 2, 2018

Here's the contents:

13:name=portage:/
12:pids:/
11:net_prio:/
10:perf_event:/
9:net_cls:/
8:freezer:/
7:devices:/
6:memory:/
5:blkio:/
4:cpuacct:/
3:cpu:/
2:cpuset:/
1:name=openrc:/sshd
0::/sshd
@kensington

This comment has been minimized.

Copy link
Collaborator Author

kensington commented Feb 2, 2018

I note that this only happens in a chroot, it works fine on the host system.

@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented Feb 2, 2018

@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented Mar 28, 2018

Sorry for the delay. Making a user session tracker work in a chroot is pointless. But having all tests to pass is a "nice-to-have" feature I really want, so I'll dig into this once the current version has caught up with systemd a bit.

@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented May 30, 2018

A little update: Within the upstream commits for v237 I have seen new stuff for "In-Chroot-Detection". I haven't looked further, yet, but I hope this'll help resolving this issue.

@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented Jun 22, 2018

@kensington : I haven't forgotten this, I just think it isn't super high priority. Gentoo can work around this alright.

However, I am almost done preparing the next releases, and will look into this next.

Yamakuzure added a commit that referenced this issue Jan 5, 2019

Prep v239.4: Fix cg_path_get_session() error return
When no session could be found, the systemd code returns -ENXIO,
while the elogind specific part returns -ENOENT.
The problem is, that the first is understood as a simple lack of data
and is not considered to be a hard error in calling functions, while
the latter is wreaking havoc.

This ultimately led to:
Bug: #45 #105
Signed-Off-By: Sven Eden <sven.eden@prydeworx.com>

Yamakuzure added a commit that referenced this issue Jan 5, 2019

Prep v239.4: Fix cg_path_get_session() error return
When no session could be found, the systemd code returns -ENXIO,
while the elogind specific part returns -ENOENT.
The problem is, that the first is understood as a simple lack of data
and is not considered to be a hard error in calling functions, while
the latter is wreaking havoc.

This ultimately led to:
Bug: #45 #108
Signed-Off-By: Sven Eden <sven.eden@prydeworx.com>
@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented Feb 16, 2019

@kensington : Does it also fail when elogind is running outside the chroot? Does it still fail with v239-stable?

Yamakuzure added a commit that referenced this issue Feb 20, 2019

Prep 239.4: Fix test-login when elogind hasn't run before
When elogind is built, it might be a fresh install.
The test-login program might then crash if /run/systemd is either
absent or not populated.

This patch checks for these circumstances and skips tests that can
succeed.

Bug: #45
Bug: #108
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>

Yamakuzure added a commit that referenced this issue Feb 20, 2019

Prep 239.4: Fix test-login when elogind hasn't run before
When elogind is built, it might be a fresh install.
The test-login program might then crash if /run/systemd is either
absent or not populated.

This patch checks for these circumstances and skips tests that can
succeed.

Bug: #45
Bug: #108
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented Feb 20, 2019

@kensington : I think I have solved this issue. Could you please test latest v239-stable?

@kensington

This comment has been minimized.

Copy link
Collaborator Author

kensington commented Mar 7, 2019

Sorry for the delay in testing. All 239 tests pass in a chroot now. Thanks!

@kensington kensington closed this Mar 7, 2019

@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented Mar 9, 2019

@kensington I am very happy that we have solved this. Finally! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.