Trying many possible combinations of settings I solved it but the conclusion is that there is something amiss with Xfce's session manager settings or GUI.
What I have verified is:
- As stated in the question, when this problem happens, under Settings/Login Window/Security - "Enable automatic login" is checked, like so:
Enable timed login is not checked.
- The odd thing is that in order to avoid typing username & password after logging out it is enough to check 'Enable timed login'. The login window appears but just 'Enter' is needed to start session in this case:
- Even with 'Enable automatic login' unchecked, typing username & password after logging out is not necessary if 'Enable timed login' is checked.
That doesn't make too much sense to me, but it works.
Edit after restart:
Because (related to a different problem - here) "Automatically save session on logout" (Menu/Settings/Session and Startup - General tab) was disabled, the solution above was not saved after startup.
So, in case session automatic saving is disabled, make the 'good' settings as in the images above and in Menu/Settings/Session and Startup - Session tab: click "Save session" button.
In this way, after logout, username and password are not required to login in the default session, but are required to login into a different one. This may seem odd, considering the fact that in Settings/Session and Startup/General there is an option to 'Display chooser on login'. But checking that displays only DE-specific sessions (the ones saved within a certain DE, that is within the generic "session").
In fact it seems that passwords are asked for desktop environments, not for saved "sessions".
This double meaning of "session" is confusing.
There is no logic in this, this solution is just a limited workaround, there may be many other variables depending on other settings that I haven't touched yet.
For example, the login experience varies even depending on the style and theme of the login window... Some of the themes may display the username as a button (if Style "Themed with faced browser" is selected under Under Settings/Login Window/Local), but some may not; clicking enter as said above would enter the session directly; but clicking that username button makes necessary the password.
Hopefully this application (Xfce4-session) will be in better shape in a future update.
Given the context of wanting to reboot a Linux system, I would take a multi-pronged approach.
First, disable future logins by creating an /etc/nologin
file. You could leave it blank or enter informative text in there, such as:
"Logins to this system have been temporarily disabled in preparation for a server reboot, scheduled for (time and date). Please try again after (expected end time)."
Don't forget to remove /etc/nologin when you're done!
Additionally, since a reboot will clear all processes, whether they're interactive or not, I would use ps
to look for processes owned by users. This will take some manual investigation to determine whether the processes are worth keeping or not, but should narrow the field some. I've hard-coded 1000 here as the value of UID_MIN from /etc/login.defs as the cutoff for "system" vs "user" UIDs. If any of your users have UIDs below 1000, you'll need to adjust that number.
ps -eo pid,uid,args | awk '$2 >= 1000'
Of course, you could adjust the ps
columns to taste, perhaps to add the translated username and process start time (ps -eo pid,uid,user,start,args
) or others -- just be careful to keep the ps
UID and awk
field in sync with each other.
To get the list of unique user names, use:
ps -eo user,uid | awk 'NR>1 && $2 >= 1000 && ++seen[$2]==1{print $1}'
Best Answer
man 5 utmp gives good answer: