Bug 2155169 - logind doesn't start the user@.service when the user is still in the host [NEEDINFO]
Summary: logind doesn't start the user@.service when the user is still in the host
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: systemd
Version: 8.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: David Tardon
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-20 09:41 UTC by Masahiro Matsuya
Modified: 2023-07-18 22:06 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-17 12:56:28 UTC
Type: Bug
Target Upstream Version:
Embargoed:
hartsjc: needinfo? (dtardon)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-142946 0 None None None 2022-12-20 09:43:10 UTC

Description Masahiro Matsuya 2022-12-20 09:41:12 UTC
Description of problem:

Even while the user is still on the host with logged-in status, the user@.service can be stopped with systemctl stop user manually. There are some situations that user is not running but the user is still on the host.

A customer had a expectation that the systemd-logind should start the user if it's not running, even if the user is available with logged-in status.

Currently, it's checked in user_start() as below.

int user_start(User *u) {
        assert(u);

        if (u->started && !u->stopping)
                return 0;
... snip ...

        /* Start user */
        user_start_service(u);

So, the user is checked, but the status of user is not checked.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 8.7

How reproducible:
Always

Steps to Reproduce:
1. login with a test user (UID=1000)
2. confirm if user is running, and stop it.
3. login with the same test user (UID=1000) to make another session.
4. check if user is running or if systemd -user is running for UID=1000

Actual results:
The systemd-logind doesn't start user when the user is available.

Expected results:
The systemd-logind can start user if it's not activated, even when the user is available.

Comment 1 David Tardon 2023-01-05 15:15:19 UTC
Is there an actual user scenario where this issue surfaces? Because from the description it looks like a self-inflicted problem.

Comment 2 James Hartsock 2023-01-05 15:27:28 UTC
did not see that it was manually stopped in the logs provided by customer in attached case.

Comment 3 James Hartsock 2023-01-05 15:28:49 UTC
Oops hit submit with out asking, if that is what you mean by "self-inflicted"

Comment 4 David Tardon 2023-01-06 08:31:20 UTC
(In reply to James Hartsock from comment #2)
> did not see that it was manually stopped in the logs provided by customer in
> attached case.

Well, the first sentence of the bug description says it. That kinda gives one an idea that's what the customer is doing... If that's not the case, it would be interesting to see how it was stopped. Could you attach the log here?

Comment 7 David Tardon 2023-03-22 16:04:16 UTC
Can we see the output of

# systemctl cat user@.service

?


Note You need to log in before you can comment on or make changes to this bug.