Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2155169

Summary: logind doesn't start the user@.service when the user is still in the host
Product: Red Hat Enterprise Linux 8 Reporter: Masahiro Matsuya <mmatsuya>
Component: systemdAssignee: David Tardon <dtardon>
Status: CLOSED MIGRATED QA Contact: Frantisek Sumsal <fsumsal>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.7CC: dtardon, hartsjc, msekleta, rmetrich, systemd-maint-list
Target Milestone: rcKeywords: MigratedToJIRA, Reopened
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-25 23:26:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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

?

Comment 18 RHEL Program Management 2023-09-25 23:25:07 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 19 RHEL Program Management 2023-09-25 23:26:10 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.