Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
1 answers
2487 views
lxsession-logout vs lxde-logout
I'm new with lxde, I installed it on ubuntu 14.04 using `sudo apt-get install lxde.` But the problem I have is that I want to logout without a prompt. I've read some articles about this and they suggested one of these: `lxsession-logout or lxde-logout`. But they cannot be used to logout without a pr...
I'm new with lxde, I installed it on ubuntu 14.04 using sudo apt-get install lxde. But the problem I have is that I want to logout without a prompt. I've read some articles about this and they suggested one of these: lxsession-logout or lxde-logout. But they cannot be used to logout without a prompt. The question is what are the main differences between them? Is it possible to logout without a prompt on lxde? thanks.
user180394 (21 rep)
Jul 19, 2016, 01:02 PM • Last activity: Jul 9, 2025, 09:08 PM
9 votes
1 answers
4732 views
How to attach to a tmux session after deleting it's session file?
`tmux` keeps track of active sessions in a file, on my system this is in `/tmp/tmux-1000/default`. Recently I manually cleared everything in the `/tmp` directory, removing this session file. Normally, you can use `tmux attach` to reattach to a session. Active sessions can be listed using `tmux ls`....
tmux keeps track of active sessions in a file, on my system this is in /tmp/tmux-1000/default. Recently I manually cleared everything in the /tmp directory, removing this session file. Normally, you can use tmux attach to reattach to a session. Active sessions can be listed using tmux ls. Because this file is gone, tmux doesn't know about any active sessions: $ tmux attach no sessions $ tmux ls error connecting to /tmp/tmux-1000/default (No such file or directory) Using top I can verify tmux is still running, along with the applications I had opened in that session. How can I reattach to this session, after I've removed the session file?
Tim Visee (445 rep)
Jan 24, 2019, 01:21 PM • Last activity: Jun 24, 2025, 09:28 AM
2 votes
1 answers
2529 views
Exporting $PULSE_SERVER at start up
In order to run flatpak applications (like Discord or Spotify) I currently have to export the `$PUSLE_SERVER` in my `~/.zshrc` or `~/.bashrc` like so: export PULSE_SERVER=unix:/tmp/pulse-PKdhtXMmr18n/native After reading this [part][1] of the pulse audio FAQ I believe I can get this working by using...
In order to run flatpak applications (like Discord or Spotify) I currently have to export the $PUSLE_SERVER in my ~/.zshrc or ~/.bashrc like so: export PULSE_SERVER=unix:/tmp/pulse-PKdhtXMmr18n/native After reading this part of the pulse audio FAQ I believe I can get this working by using ~/.config/pulse/client.conf. I have tried adding either of the following two lines to my ~/.config/pulse/client.conf: default-server = unix:/tmp/pulse-PKdhtXMmr18n/native And: auto-connect-display = yes NOTE: I tried the second because someone on the IRC suggested that flatpak may be looking at something related to X11 for the $PULSE_SERVER. After trying an env | grep PULSE the $PULSE_SERVER does not appear to be being set. Furthermore neither of these approaches seem to have any effect (in saying that the first seemed to interfere with the session start as it stopped my polybar from starting, I have no idea why or how to debug this). The main reason for wanting to define the $PULSE_SERVER elsewhere is I don't want to have to declare it in each shell and I would like to keep all the pulse config in one place. I originally tried adding the above export to my ~/.xprofile (I use SDDM to start my session) however this stopped the pulse folder from being created in /tmp/. Additional Info: I am running void linux with the bspwm window manager.
Otis Wright (121 rep)
Jan 2, 2019, 08:14 AM • Last activity: May 24, 2025, 07:02 AM
2 votes
2 answers
2943 views
w command doesn't show all pseudo-terminal sessions
If I open terminal and execute `w` command then it will show: user tty7 :0 12:04 39:56 36.87s 0.06s /sbin/upstart - Now if open `terminator` or `xterm` and execute `w` command then it will show it's entry in the output of `w` command like user tty7 :0 12:04 39:56 36.87s 0.06s /sbin/upstart - user pt...
If I open terminal and execute w command then it will show: user tty7 :0 12:04 39:56 36.87s 0.06s /sbin/upstart - Now if open terminator or xterm and execute w command then it will show it's entry in the output of w command like user tty7 :0 12:04 39:56 36.87s 0.06s /sbin/upstart - user pts/2 :0.0 12:50 1.00s 0.02s 0.00s w but it will not show a new entry when I open gnome-terminal or xfce4-terminal. Why it is showing new session for terminator and not for xfce4-terminal?
Prvt_Yadav (6032 rep)
May 4, 2018, 07:25 AM • Last activity: Mar 25, 2025, 03:02 PM
0 votes
2 answers
171 views
su -l not working, loginctl shows a different user
I want to switch to a different user, but loginctl shows that the previous user session is being used I start as the user `ubuntu`. ```sh $ loginctl session-status | head -n1 2 - ubuntu (1000) ``` ```sh sudo su -l newuser # I even used the --login flag!! Which should LOG IN! ``` ```sh $ loginctl ses...
I want to switch to a different user, but loginctl shows that the previous user session is being used I start as the user ubuntu.
$ loginctl session-status | head -n1
2 - ubuntu (1000)
sudo su -l newuser # I even used the --login flag!! Which should LOG IN!
$ loginctl session-status | head -n1
2 - ubuntu (1000)
This affects things like lingering. **How do I switch to another user (without password), in a way that loginctl understands?** EDIT: For context, a service program running as that user is having issues, and I am trying to reproduce that environment in an interactive debugger. I worry that the login session is producing different behavior (specifically in regards to the linger user setting).
Paul Draper (474 rep)
Mar 10, 2025, 03:38 PM • Last activity: Mar 15, 2025, 09:56 PM
0 votes
0 answers
25 views
spawn process with existing session ID (setsid, maybe use GDB)
How to create a new process with the [session ID][1] (setsid) of an existing process? I have an idea using GDB which is working partly. But I'm also thankful for other approaches. . There seems to be no syscall where I can specify a session ID for a process. But I was inspired by [another conversati...
How to create a new process with the session ID (setsid) of an existing process? I have an idea using GDB which is working partly. But I'm also thankful for other approaches. . There seems to be no syscall where I can specify a session ID for a process. But I was inspired by another conversation , where GDB is being used. So my idea is, to use GDB to fork a process from an existing one with the desired session ID. The basic idea seems to work. But it suffers from a segmentation fault in the original process.
# start some long running process in it's own session
setsid --fork bash -c 'echo $$; sleep 1000'
# outputs it's PID == SESSION_ID (lets assume "100")

gdb --init-eval-command='set follow-fork-mode child' -p SESSION_ID

# in gdb:
call (int)fork()
# PROBLEM: original command outputs:
#   Segmentation fault      (core dumped) sleep 1000
call (int)execl("/bin/sleep", "sleep", "50")

ps --sid SESSION_ID -o pid,sid,args
#  101  100  sleep 50
#  102  100  sleep 120
So the original process "100" has crashed. But the new process successfully started. Any idea how to avoid the segfault? Related: Is there a way to change the process group of a running process?
kolAflash (11 rep)
Feb 26, 2025, 10:46 AM • Last activity: Feb 26, 2025, 10:47 AM
5 votes
1 answers
438 views
Weird shell variable expansion in bash
The bash manual says "The environment for any simple command or function may be augmented temporarily by prefixing it with parameter assignments". I also understand that exported variables are by default passed to subprocesses that bash creates. I'm testing some behaviours with non-exported variable...
The bash manual says "The environment for any simple command or function may be augmented temporarily by prefixing it with parameter assignments". I also understand that exported variables are by default passed to subprocesses that bash creates. I'm testing some behaviours with non-exported variables, and what I don't understand is how it works when the assignments are followed by the ; operator, and then some other commands are executed. My case is the following: VAR=hello; echo $VAR prints "hello". VAR=hello :; echo $VAR prints a newline. VAR=hello; echo $VAR; bash -c 'echo $VAR' prints "hello" and a newline. The question is, in the first and third command, why is VAR being expanded? They are different commands, with (apparently) no parameter assignments prefixed. I've tried in bash 4.4.20 and 5.1.16, having the same behaviour on both.
carce-bo (197 rep)
Feb 10, 2025, 03:27 PM • Last activity: Feb 16, 2025, 05:51 PM
2 votes
2 answers
6344 views
How to start a minimal Wayland session from command line?
A way to debug X is that I start an X server (`X -ac :0`), then an xterm (`DISPLAY=:0 xterm`) and a WM on it (`DISPLAY=:0 icewm`). It is unthinkably useful is there is a display problem. What can I do with wayland? I absolutely do not want a full gnome, I just want a terminal and a VM - and see from...
A way to debug X is that I start an X server (X -ac :0), then an xterm (DISPLAY=:0 xterm) and a WM on it (DISPLAY=:0 icewm). It is unthinkably useful is there is a display problem. What can I do with wayland? I absolutely do not want a full gnome, I just want a terminal and a VM - and see from the error output, if anything is bad. I would also miss dbus, if possible.
peterh (10448 rep)
Apr 21, 2024, 12:30 AM • Last activity: Feb 15, 2025, 11:20 AM
22 votes
5 answers
38791 views
How can I run a script that starts before my login screen?
I was calibrating my touch screen, and saw that the best tool around was xinput_calibrator. So I used it. It have two options (one of which did not work), so I am here for the second. It says I should execute this command "in a script that starts with your X session": `xinput set-int-prop "3M 3M USB...
I was calibrating my touch screen, and saw that the best tool around was xinput_calibrator. So I used it. It have two options (one of which did not work), so I am here for the second. It says I should execute this command "in a script that starts with your X session": xinput set-int-prop "3M 3M USB Touchscreen - EX II" "Evdev Axis Calibration" 32 14410 2146 14574 2115 So I tried ~/.xinitrc, ~/.xsession and ~/.xsessionrc, all of which did not exist. So I created them and the exact content was this command. The first two files made my logins fail (after I login, I fall back to the login screen). With the last file, the calibration was functional, but only after logging in... I need that command to run **before** the login dialog shows up. I thought of adding this command to the end of /etc/X11/xinit/xinitrc with no result (nothing changed). Also, I tried to add it to the end of /etc/X11/Xsession.d/40x11-common_xsessionrc (after inspecting some of the files), but the result was exactly the same as adding it to ~/.xsessionrc. How can I make this command run before the login screen shows (is this before the window manager starts, or before the X session starts)? (I am running Kubuntu with the default window manager, if that matters) **UPDATE** As I am using Kubuntu, my display manager is kdm. As the accepted answer suggests, I edited the file /etc/kde4/kdm/Xsetup, and as mentioned [here](http://maketecheasier.com/run-startup-scripts-in-kdm-before-kde-starts/2011/12/15) I added the command before the command that is there by default. And it works like a charm :)
jadkik94 (1013 rep)
Jul 8, 2012, 08:53 PM • Last activity: Feb 12, 2025, 03:20 PM
2 votes
1 answers
151 views
Linux what killed my process and how to prevent
I have the following bashscript that's being run by crontab. The process can take up to 3 days to complete. I see in the logs it makes it through 1 full day but on the 2nd day of running it just stops at exactly 7:25 UTC. My questions are the following. 1. Where can I see what is killing this job at...
I have the following bashscript that's being run by crontab. The process can take up to 3 days to complete. I see in the logs it makes it through 1 full day but on the 2nd day of running it just stops at exactly 7:25 UTC. My questions are the following. 1. Where can I see what is killing this job at this time (is it a server restart or what). - I don't think it's memory related since it's happening at the exact same time several tries in a row. - I checked the last reboot and the dates don't coincide (last reboot 12/03/2024). I think something is killing the session thats running the job. - When I run the java executable manually (not using crontab or the bashscript) using **setsid** it never seems to get killed. 2. How can I prevent this long running job from being killed. - Going to try adding **setsid** to the bashscript to see it that prevents it from being killed. speedrunappimportfull_job.sh (bashscript): cd /srv/speedrunappimportjrefull/ && java -jar speedrunappimport-0.0.1-SNAPSHOT.jar --isReload=true >> /var/log/speedrunappimportjre/speedrunappimportjrenew-"date +"%d-%m-%Y"".log 2>&1 crontab -e: 0 0 1 * * /usr/bin/flock -n /tmp/speedrunappimportfull.lockfile bash /srv/speedrunappimportfull_job.sh log indicates something is killing the process at 07:25 (log just abruptly stops): 2025-01-15T07:25:25.765Z INFO 1801430 --- [ main] s.configuration.DIConfiguration : Saved runs 14392/ 24602 2025-01-15T07:25:25.850Z INFO 1801430 --- [ main] s.configuration.DIConfiguration : Saved runs 14393/ 24602 2025-01-15T07:25:25.941Z INFO 1801430 --- [ main] s.configuration.DIConfiguration : Saved runs 14394/ 24602
mgmedick (31 rep)
Jan 15, 2025, 09:36 PM • Last activity: Jan 21, 2025, 04:19 PM
2 votes
2 answers
165 views
Why is session defined on kernel level? Is it introduced exclusively for tty/job control?
I have read a lot of articles and questions/answers on this site about sessions. I understand what they represent ([source](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html)) : > A collection of process groups established for job control purposes. > Each process group is a me...
I have read a lot of articles and questions/answers on this site about sessions. I understand what they represent ([source](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html)) : > A collection of process groups established for job control purposes. > Each process group is a member of a session. A process is considered > to be a member of the session of which its process group is a member However, my question is, is the session as part of the "core" of the kernel (part of the task structure) purely because of the terminal and job control? In other words, **is the goal of introduction just for that reason, or is the session introduced "for a higher purpose" and is used (or intended to be used) in other situations as well, where the terminal being just one of them?** If it's true that it's only because of the terminal, I think it makes little sense to me. It could be implemented at the shell level (as is the case with job control). I understand why process groups exist at the kernel level, for example to group processes and do something with them together (send a signal to entire group), but I don't understand the session, what do they bring to me at the kernel level...
Yakog (517 rep)
Jan 19, 2025, 03:28 PM • Last activity: Jan 20, 2025, 03:53 PM
1 votes
1 answers
1003 views
how to setarch for each bash session
I am using bash as my default shell. I don't have root access. But I would like to customize my bash by setarch. So the question is how to do this automatically? Currently, I have to manually run "setarch ... /bin/bash" when I want to use thecustomized bash. Is there a way that this setarch is alway...
I am using bash as my default shell. I don't have root access. But I would like to customize my bash by setarch. So the question is how to do this automatically? Currently, I have to manually run "setarch ... /bin/bash" when I want to use thecustomized bash. Is there a way that this setarch is always automatically done for all my bash sessions?
yeeha
Jan 26, 2013, 12:26 AM • Last activity: Nov 19, 2024, 07:09 PM
0 votes
0 answers
59 views
Start a screenlocker in user session, from a system wide systemd service
I have seen [this question][1], but the complexity of the answer makes me question if I am on the right path at all. I want to setup Ubuntu to always start a screenlock on suspend. I also want to do it right, even if my actual usecase does not require it, for the learning experience. What I am tryin...
I have seen this question , but the complexity of the answer makes me question if I am on the right path at all. I want to setup Ubuntu to always start a screenlock on suspend. I also want to do it right, even if my actual usecase does not require it, for the learning experience. What I am trying to achieve: - System wide setup to start the screenlocker for any user logged in on the computer, on closed lid - each user maybe use environment variables to point to a directory of images, to be used by the screenlocker. What I have so far: - a script in /usr/local/bin to start the screenlock. This uses xsecurelock - xsecurelock installed - a service in /etc/systemd/system, which calls the script with ExecStart My issue is to let systemd run the start script, in the currently active session. I could retrieve the active session with this:
for session_id in $(loginctl list-sessions --no-legend | awk '{ print $1 }') ; do
    state=$(loginctl show-session -p State --value $session_id)
    if [[ "$state" == "active" ]] ; then
	    active_session_id=$session_id
	    active_user=$(loginctl show-session -p User --value $session_id)
    fi
done
, but I don't know how to call the script in that existing session. I feel that there might be a better simpler way to do this altogether. Should I make a systemd user service? In that case, how do I ensure that all users have such a service? My best attempt at the locking, using sudo -u to run as the found user, but not trying to reconnect to the session itself:
#!/bin/bash

# Get the active session ID and user for the currently logged-in graphical session

for session_id in $(loginctl list-sessions --no-legend | awk '{ print $1 }') ; do
    state=$(loginctl show-session -p State --value $session_id)
    if [[ "$state" == "active" ]] ; then
	active_session_id=$session_id
	active_user=$(loginctl show-session -p Name --value $session_id)
    fi
done

sudo -u $active_user bash -l -c "source ~/.config/xsecurelock.env ; xsecurelock"
, then I export the variables that xsecurelock uses in my user's xsecurelock.env. It fails because "Could no connect to $DISPLAY":
$ sudo systemctl status lock-on-suspend.service 
× lock-on-suspend.service - Lock screen on suspend
     Loaded: loaded (/etc/systemd/system/lock-on-suspend.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2024-11-11 09:37:19 CET; 2min 33s ago
    Process: 115803 ExecStart=/usr/local/bin/lock-with-image (code=exited, status=1/FAILURE)
   Main PID: 115803 (code=exited, status=1/FAILURE)
        CPU: 46ms

nov 11 09:37:19 L34NJKX3 systemd[1] : Starting Lock screen on suspend...
nov 11 09:37:19 L34NJKX3 sudo:     root : PWD=/ ; USER=gostervall ; COMMAND=/usr/bin/bash -l -c 'source ~/.confi>
nov 11 09:37:19 L34NJKX3 sudo: pam_unix(sudo:session): session opened for user gostervall(uid=1000) by (uid=0)
nov 11 09:37:19 L34NJKX3 lock-with-image: 2024-11-11T08:37:19Z 115818 xsecurelock: Could not connect to $DISPLAY.
nov 11 09:37:19 L34NJKX3 sudo: pam_unix(sudo:session): session closed for user gostervall
nov 11 09:37:19 L34NJKX3 systemd[1] : lock-on-suspend.service: Main process exited, code=exited, status=1/FAILURE
nov 11 09:37:19 L34NJKX3 systemd[1] : lock-on-suspend.service: Failed with result 'exit-code'.
nov 11 09:37:19 L34NJKX3 systemd[1] : Failed to start Lock screen on suspend.
Am I on the right path? Should I just try and pass DISPLAY to the subshell?
Gauthier (909 rep)
Nov 9, 2024, 06:37 PM • Last activity: Nov 11, 2024, 08:42 AM
5 votes
4 answers
1796 views
SSH-like session that survives physical network disconnection
I want my SSH login session to remain connected after the computer goes to sleep and wakes up. From what I understand TCP can survive intermittent network problems, so can I change settings so that it can survive for a few hours or days? If not, is there anything similar to SSH that can do that? I u...
I want my SSH login session to remain connected after the computer goes to sleep and wakes up. From what I understand TCP can survive intermittent network problems, so can I change settings so that it can survive for a few hours or days? If not, is there anything similar to SSH that can do that? I understand that I can set SSH up to automatically reconnect when network becomes available again. But this is not ideal because I want my login session to be in exactly the same place where it was before the laptop went to sleep (even if it's half-way through typing something in the shell command line). I understand there are other [workarounds](https://unix.stackexchange.com/questions/22781/how-to-recover-a-shell-after-a-disconnection) , but I was hoping there's a way to avoid losing the shell session in the first place.
max (151 rep)
Oct 20, 2016, 08:32 PM • Last activity: Nov 6, 2024, 08:43 PM
2 votes
3 answers
2764 views
dwm - session polkit
I am really struggling to get the session polkit to work. I am not really familiar with how it works, but I have been using gnome before switching to dwm and in gnome it worked perfectly, so I wanted to replicate that. First of all: As I understood it, the polkit is responsible for giving momentary...
I am really struggling to get the session polkit to work. I am not really familiar with how it works, but I have been using gnome before switching to dwm and in gnome it worked perfectly, so I wanted to replicate that. First of all: As I understood it, the polkit is responsible for giving momentary privilege escalation to the user, by prompting him for the root password. Is this correct? How can I replicate that behavior without a DE but with a WM like dwm?
weisbrja (251 rep)
Jan 9, 2021, 03:59 PM • Last activity: Oct 29, 2024, 08:23 AM
1 votes
0 answers
66 views
Send a single command through tmux at the start of every pane every session
I am using a Solaris server which I cannot alter even as a normal user for "security reasons", but I still have to daily interact in it. **TLDR I have absolutely no root access to the server, no way to add files in the $HOME and I just want to set up a few tweaks. While using TMUX, all my custom pre...
I am using a Solaris server which I cannot alter even as a normal user for "security reasons", but I still have to daily interact in it. **TLDR I have absolutely no root access to the server, no way to add files in the $HOME and I just want to set up a few tweaks. While using TMUX, all my custom preferences are flushed for the default profile which I can't work with.** **I need a method to launch a command (either launch a script or a stty erase ^? ) at every tmux instanctiation.** For context, it was forbidden to use any profile / session alteration as several users go through the same user and the $HOME, .profile and the shell cannot be switched. This also means I cannot change any config file in their default directory. What I did was : - Launch a first command with my ssh -t connection, which allowed me fix the stty erase ^? - Set a few env vars in a script, which cannot be launched at connection from login, unless I add it in the SSH args as a command on login. - Set a few aliases in a folder. The aliases are pretty much : vim -u ./myfolder/.vimrc or the same with tmux tmux -f ./myfolder/.tmux. Now I have set up every but the terminal stty erase ^? keeps erasing on every pane, session I set in TMUX. I've read a lot about sending a command on the creation of a session or on multiple windows but nothing about having a small command on the start of any tmux pane, window, session. Is there any way to do that ? The closest I got was reading the tmux configuration from Arch : https://wiki.archlinux.org/title/Tmux I noticed you could start a non login session or set up custom keys, but both methods failed.
SinD (21 rep)
Aug 30, 2024, 12:39 PM
1 votes
1 answers
370 views
How to run script on XFCE4 logon and logoff?
I'd like to run a shell script each time a (specific) user logs in to his XFCE4-session, as well as run another script each time that user logs off. So far, I was able to create a script at `~/.config/xfce4/xinitrc` and run my script at logon from there. But I couldn't figure out how to run a script...
I'd like to run a shell script each time a (specific) user logs in to his XFCE4-session, as well as run another script each time that user logs off. So far, I was able to create a script at ~/.config/xfce4/xinitrc and run my script at logon from there. But I couldn't figure out how to run a script at logout / logoff or when a user issues a shutdown of the computer from within XFCE4. Importantly, those script are not to be run at system boot or shutdown, rather each time a user logs in or off through XFCE4, i.e. starting the session or ending it, respectively.
polemon (11921 rep)
Jul 29, 2024, 07:46 AM • Last activity: Jul 29, 2024, 09:15 PM
8 votes
3 answers
2647 views
Is it possible to style tmux on a per-session basis?
I set up 2 tmux sessions to work on different parts of a project (switching back and forth frequently). As their layout are pretty similar, I would like to set different status-bar color to help me quickly identify the current session. After reading the manual, it seems that set -t session_name stat...
I set up 2 tmux sessions to work on different parts of a project (switching back and forth frequently). As their layout are pretty similar, I would like to set different status-bar color to help me quickly identify the current session. After reading the manual, it seems that set -t session_name status-bg blue would be what I am looking for. But running that command changes both session status-bar color. Is it possible to achieve a per-session styling in tmux ? I also tried naming the window and pass its name to -t but was no more successful. Can't find that information. Also, I might not get tmux session use-case right.
zrz (181 rep)
Aug 27, 2015, 08:47 AM • Last activity: Jul 11, 2024, 09:26 AM
0 votes
1 answers
1386 views
How can I get the list of available desktop environments?
Suppose I'm on a Linux machine, in a shell session, and I want to obtain the list of options I would have if I logged in graphically and had to choose a desktop environment / session type. I expect a list with items such as "kde", "gnome", "xfce4", "cinnamon" etc. Notes: * I would hope for a distrib...
Suppose I'm on a Linux machine, in a shell session, and I want to obtain the list of options I would have if I logged in graphically and had to choose a desktop environment / session type. I expect a list with items such as "kde", "gnome", "xfce4", "cinnamon" etc. Notes: * I would hope for a distribution-agnostic solution, but if you must know the distro - assume it's RHEL or Centos-based. * I'm not picky about the exact naming scheme, the names can be longer/shorter form, one-per-line or otherwise, that really doesn't matter.
einpoklum (10753 rep)
Jun 6, 2024, 11:38 AM • Last activity: Jun 6, 2024, 11:52 AM
1 votes
1 answers
806 views
KDE Wayland session crashing when waking from standby or the screenlocker - how to find out why?
I'm running Debian 11 with KDE and Wayland. This is a problem of Wayland instead of X11 with the version of KDE of Debian11. When I wake from standby I usually have that other login screen that also shows when booting instead of the one that shows when waking from standby. It starts a new session (a...
I'm running Debian 11 with KDE and Wayland. This is a problem of Wayland instead of X11 with the version of KDE of Debian11. When I wake from standby I usually have that other login screen that also shows when booting instead of the one that shows when waking from standby. It starts a new session (and I have to restart all the running apps) instead of resuming the session like it used to when resuming from standby. How to find out what's causing this? If possible any hints that could help solve the problem would be useful. I know Wayland support on KDE Plasma 5.20.5 isn't good but overall it worked for a long time despite a few issues until a few days ago when it crashes all the time with The Wayland connection broke. Did the Wayland compositor die?. With sudo journalctl | tail -n 1000 I found these log-entries (after the time the wakeup occurred) that may be relevant:
...
systemd-sleep: System resumed.
polkitd(authority=local): Unregistered Authentication Agent for unix-session:21 (system bus name :1.335, object path /org/kde/PolicyKit1/AuthenticationAgent, locale .._...UTF-8) (disconnected from bus)
...
systemd: Starting Refresh fwupd metadata and update motd...
anacron: Jobs will be executed sequentially
systemd: Starting Rotate log files...
systemd: Starting Daily man-db regeneration...
fwupd: FuPluginLinuxSwap    could not parse /proc/swaps: Error when getting information for file "/home/username/swapfile": No such file or directory
systemd: fwupd-refresh.service: Succeeded
systemd: Finished Refresh fwupd metadata and update motd.
kernel: kwin_wayland: segfault at 0 ip 0000000000000000 sp 00007ffd113c1538 error 14 in kwin_wayland[556620415000+12000]
kernel: Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
...
org.kde.ActivityManager: kf.notifications: env says KDE is running but SNI unavailable -- check KDE_FULL_SESSION and XDG_CURRENT_DESKTOP
org.kde.ActivityManager: The Wayland connection broke. Did the Wayland compositor die?
org.kde.ActivityManager: KCrash: crashing... crashRecursionCounter = 2
org.kde.ActivityManager: KCrash: Application Name = drkonqi path = /usr/lib/x86_64-linux-gnu/libexec pid = 189945
org.kde.ActivityManager: KCrash: Arguments: /usr/lib/x86_64-linux-gnu/libexec/drkonqi --appname kactivitymanagerd --apppath /usr/lib/x86_64-linux-gnu/libexec --signal 11 --pid 181538 --startupid 0
...
KSystemLog does not run under Wayland, otherwise it would be easy to quickly check other logs if there are more relevant messages. Is there something else to check? ---- This also happens when being afk and some time after the screenlocker turned on or was turned on. It doesn't happen always but most of the time the machine is left alone. In the logs there's this for example (for one of the crashes):
kernel: show_signal_msg: 53 callbacks suppressed
kernel: kwin_wayland: segfault at 29e700000000 ip 00007ff25989dc70 sp 00007ffe1e2adfe8 error 4 in libgbm.so.1.0.0[7ff25989d000+7000]
kernel: Code: 00 16 00 00 00 31 c0 48 83 c4 08 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 8b 07 ff a0 48 01 00 00 0f 1f 80 00 00 00 00  8b 07 ff a0 30 01 00 00 0f 1f 80 00 00 00 00 48 8b 07 ff a0 38
org.kde.ActivityManager: The Wayland connection broke. Did the Wayland compositor die?
org.kde.ActivityManager: KCrash: crashing... crashRecursionCounter = 2
org.kde.ActivityManager: KCrash: Application Name = kactivitymanagerd path = /usr/lib/x86_64-linux-gnu/libexec pid = 2460
org.kde.ActivityManager: KCrash: Arguments: /usr/lib/x86_64-linux-gnu/libexec/kactivitymanagerd
org.kde.ActivityManager: KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi
pulseaudio: X connection to :1 broken (explicit kill or server shutdown).
---- It started happening when I enabled an additional display under Display Configuration and then only enabled the other display and disabled the former display and then reversed it to switch back to the former display. There have been some crashes in between. [I did this multiple times before as a workaround to be able to switch to another display](https://unix.stackexchange.com/posts/722870) without a crash and without having to end the session as this often works without a crash (only some Qt apps are crashing). However, doing this never caused this problem until a few days ago. Other than that I only installed a few recent upgrades, the only ones that could be relevant are sudo and firefox. The system has the latest updates. /home/username/swapfile does exist. Sadly [it's STILL vulnerable to this bluetooth vulnerability](https://github.com/fwupd/fwupd/issues/4259) so this may be relevant to fwupd. I also quit the logrotate process once recently because it filled my home drive disk space.
mYnDstrEAm (4708 rep)
Jan 21, 2023, 10:43 AM • Last activity: Apr 11, 2024, 06:05 PM
Showing page 1 of 20 total questions