Bug 1758900 - Processes disowned from GUI-based shells are improperly disowned
Summary: Processes disowned from GUI-based shells are improperly disowned
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 42
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1357426
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-06 16:48 UTC by Karl
Modified: 2025-02-26 12:50 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-05-10 14:41:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
MPI program to catch all signals sent to the child processes, generating output every 10 seconds. This should verify that no catchable signals are being sent. (578 bytes, text/x-csrc)
2019-10-06 16:48 UTC, Karl
no flags Details

Description Karl 2019-10-06 16:48:43 UTC
Created attachment 1622935 [details]
MPI program to catch all signals sent to the child processes, generating output every 10 seconds. This should verify that no catchable signals are being sent.

Description of problem:
When a background process (e.g., a multiprocessor task started from mpiexec) is disowned from within the GUI, it is killed when the user logs out. The disowned processes are being killed with SIGKILL, so there is no way to prevent their demise.

Version-Release number of selected component (if applicable):
systemd-241-12.git1e19bcd.fc30.x86_64

How reproducible:
I have managed to reproduce this on two different machines.

Steps to Reproduce:
1. Log in on both the GUI and the text-only console
2. Start Gnome Terminal on the GUI.
3. Run a process that you intend to remain running after you log out that does not require access to DISPLAY.
4. Disown that process from the shell, exit the shell, and log out.
5. Switch to the text-only console on which you are logged in and verify that the process is still running (it will be) and producing output. Its PPID will be that of a systemd process owned by the user.
6. Log out of the text-only console.
7. Wait a minute or so, then log back in, either on the GUI or on one of the text-only consoles.
8. Check the process you had before; if it works as it does for me, it will be absent from the process listing, and no output will be produced.

Actual results:
Dead process and/or process disowned only as far as systemd.

Expected results:
Process continues, independent of user activity, until sent a signal (including if system reboots or is shut down). Process should have a PPID of 1, which is the system-owned systemd process (not the user-owned systemd process). Alternatively, the user-owned systemd process should continue, without killing user jobs, as long as the job is running.

Additional info:
This does not happen from SSH connections. For example, using "ssh localhost" before starting the job causes it to disown properly (PPID = 1) once the shell exits.

I am using zsh as my shell, but this happens with bash as the login shell, too.

Comment 1 Ben Cotton 2020-04-30 20:13:11 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Ben Cotton 2020-05-26 18:40:44 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 3 Karl 2020-10-02 16:20:53 UTC
Reopened against Fedora 32 and systemd-245.8-2.fc32

Comment 4 Fedora Program Management 2021-04-29 15:58:39 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Karl 2022-05-29 01:05:57 UTC
This is still happening. Any updates?

Comment 6 David Tardon 2024-05-10 14:41:30 UTC
When all sessions of an user are closed, all processes still running in the user's scope are terminated. If you don't want that, run the process as a transient service/scope (using systemd-run) or enable lingering for the user (`loginctl enable-linger USER`).

Comment 7 Karl 2024-05-11 03:14:55 UTC
This is ridiculous. Fedora---and all other Linux flavors I am aware of---has supported running background jobs that do NOT exit when the user logs out for decades.

The use case is this:
 (1) Log in on the console
 (2) Use the GUI to edit files, etc., to prepare a computer simulation
 (3) Start that computer simulation
 (4) Log out and go home, letting the computer work overnight.
 (5) Come back the next morning, log back in, and check the results.

This is a very reasonable use case, and I should not have to train my users to be system administrators just to run a simulation.

Reopening this.

Comment 8 Aoife Moloney 2025-02-26 12:50:36 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.


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