i am new to Alma Linux 8.4 and i want to user AlmaLinux as an xRDP Server.
For my Session Directory, i have a Python script, that is running at user login and logout.
My problem is:
The connection via xRDP loads the target user profile, so i was able to run my login_script.py at login by configuring the user home ~/.bash_profile.
At user logout from xRDP Server, i configured the ~/.bash_logout to run my logout_script.py but my script sadly does not run at logout from xRDP.
I also have a Citrix VDA Linux Client. This one runs my script at ~/.bash_logout.
I also tried a user Service for login and logout via systemd but without success.
Just a couple of question to help you diagnose the problem for yourself.
Do you have the mailx package installed so that when events that would normally hit the console get routed to mail and saved as a message for root?
What are the perms on the python script and is it in a path that is widely available to all users that you want this script to execute for?
If you have the mailx package installed and you have print, printf or echo statements to “the screen/console” then run your test to see if the statements are printed (not likely yet because you have not made any changes), then log back in and check root’s mail.
Assuming that you do not know how to run the mail command, installed with the mailx package, you could use this Youtube video to learn how to check mail messages: Admin@LearnRHEL - Int.001 - Checking Root’s mailbut you will have to install mailx first.
And my startlogout is written like the following text
#!/bin/bash
/usr/bin/python3 /etc/profile.d/writelogout.py:
The problem there is, that the user@.service for my user runs ExecStart AND ExecStop at about the same time. That is working the same way with my own systemd service for users.