Bug 1211336 - autostarted programs get killed in plasma
Summary: autostarted programs get killed in plasma
Status: RESOLVED DUPLICATE of bug 1213156
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Leap 15.5
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: systemd maintainers
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-12 04:31 UTC by Giacomo Comes
Modified: 2023-07-18 10:17 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
modified commit 596e447076b27d1 (30.22 KB, patch)
2023-05-15 04:44 UTC, Giacomo Comes
Details | Diff
modified commit 03e19a7a5119ce8af0 (5.67 KB, patch)
2023-07-09 15:36 UTC, Giacomo Comes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Giacomo Comes 2023-05-12 04:31:24 UTC
I have a .desktop file in ~/.config/autostart
On login, the program defined in the .desktop file is normally executed.

But if the program is one that goes in the background after it is started,
it gets killed by a signal 15.

Example file1.desktop:
Exec=x11vnc -logfile /home/user/.vnc/x11vnc.log -rfbauth /home/user/.vnc/passwd -forever -bg -nodpms


Example file2.desktop:
Exec=/usr/local/bin/myscript

where myscript is:
#!/bin/bash
prog1&
prog2&

If I change myscrypt like this:
#!/bin/bash
prog1&
prog2

then upon login prog1 and prog2 get started and stay running, but when I close
prog2 then prog1 gets killed.

This problem happens only in Leap 15.5 and only for the plasma desktop.
No issue in Leaps 15.4 and previous versions nor in tumbleweed.
also LXDE, LXQT and XFCE do not show the problem.

I could not figure out if this is a plasma issue, a systemd issue, or something else.

Right now my workaround is to have in myscript something like:

#!/bin/bash
prog1&
prog2&
sleep <big number>
Comment 1 Fabian Vogt 2023-05-12 07:08:07 UTC
systemd needs commit https://github.com/systemd/systemd/commit/e83a422797b4f2d0e3b16646937d930e163c56ea

Can that be backported please?
Comment 2 Giacomo Comes 2023-05-12 14:40:05 UTC
I have tested the suggested commit and it does not fix the problem.
Comment 3 Giacomo Comes 2023-05-15 04:44:47 UTC
Created attachment 867017 [details]
modified commit 596e447076b27d1

In order to fix the bug systemd needs a second commit:
https://github.com/systemd/systemd/commit/596e447076b27d103a30c26a68626e9820ac705b
However in such commit there are a couple of hunks that fail and
the patch needs a small modification.
Attached you can find the correct patch that once applied together with the first one fixes the problem.
Comment 4 Giacomo Comes 2023-07-09 15:36:47 UTC
Created attachment 868109 [details]
modified commit  03e19a7a5119ce8af0

After reading boo#1213156 I have verified the problem with X-GNOME-Autostart-Phase. I did run:
  ln -s /usr/share/applications/gcdemu.desktop ~/.config/autostart
and after a login gcdemu did not get started.
Attached there is a slight modified version of commit:
  https://github.com/systemd/systemd/pull/26379/commits/03e19a7a5119ce8af0cbdf5d20af8b62ad820d67
which apply to the systemd sources shipped in Leap 15.5.
Once I apply this patch, upon login gcdemu get started normally.

I have patched systemd for my installations and personally I'm not affected by this bug, however it is sad to see that at SUSE they are just ignoring KDE users by not taking any action about this bug. It has been open two months ago an it appears that the screening team still has not assigned it to anybody.
Comment 5 Fabian Vogt 2023-07-09 18:17:23 UTC
(In reply to Giacomo Comes from comment #4)
> It has been open two
> months ago an it appears that the screening team still has not assigned it
> to anybody.

Apparently that got lost when I set the component to basesystem. It was meant to be assigned to systemd maintainers.
Comment 6 Giacomo Comes 2023-07-10 03:34:58 UTC
It looks like (https://github.com/openSUSE/systemd/pull/79) work is in progress to fix this problem in Leap 15.5. Better late then never.
Comment 7 Franck Bui 2023-07-13 16:38:15 UTC
(In reply to Giacomo Comes from comment #0)
> This problem happens only in Leap 15.5 and only for the plasma desktop.

Given that Leap 15.4 and 15.5 use the exact same version of systemd and the desktop file examples you provided don't seem to rely on any plasma specific features I don't see why you have troubles with Leap 15.5 and not with Leap 15.4.
Comment 8 Fabian Vogt 2023-07-13 16:54:36 UTC
(In reply to Franck Bui from comment #7)
> (In reply to Giacomo Comes from comment #0)
> > This problem happens only in Leap 15.5 and only for the plasma desktop.
> 
> Given that Leap 15.4 and 15.5 use the exact same version of systemd and the
> desktop file examples you provided don't seem to rely on any plasma specific
> features I don't see why you have troubles with Leap 15.5 and not with Leap
> 15.4.

Plasma in 15.5 uses systemd's xdg-autostart-generator.
Comment 9 Franck Bui 2023-07-18 10:17:21 UTC
Duplicate of bsc#1213156

*** This bug has been marked as a duplicate of bug 1213156 ***