[Partially SOLVED]Switch user doesnt go to MDM login manager

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
chrisonmint

[Partially SOLVED]Switch user doesnt go to MDM login manager

Post by chrisonmint »

I'd really appreciate suggestions on this issue. I have a laptop running LM17.1 XFCE with 3 user accounts set up (all using Xfce as DM). Here is my issue:

Login as user 1
Switch user (takes me to the GDM login manager screen, great)
Login as user 2
Logout user 2

What I expect to happen is to go back to the GDM login manager screen, but what actually happens is I get logged into user 1's session.

When user 2 logs out, they are dumped into user 1's session and xscreensaver is asking them for user 1's password and there isnt the option to get to the GDM login manager.

My kids are one of these users and its set to log them in without a password prompt, which works great from the login manager, but xscreensaver doesnt let them do that, so they get stuck.

My workaround has been to apt-get remove xscreensaver. This has worked to an extent:
- no password prompt for my kids when the laptop wakes from suspend
- no double-entry of passwords when logging into an already-active user (once with MDM then with xscreensaver)

BUT, now when a logout happens, you are dumped into another users' active session without password prompt. This is not ideal, basically I have to make sure my admin account is never left running.

I am happy to put xscreensaver back if that helps, but I want it to always kick me back to MDM login (on system wake from suspend and logout/switch user)

Is there a way to run MDM as my screensaver, for example?

*** edited to swap GDM for MDM - i didnt realise Mint have forked it.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
richyrich

Re: Switch user doesnt go to GDM login manager

Post by richyrich »

1) System Menu > In the Preferences tab of the Login Window program, you can try unchecking the "Automatically select the last user logged in" checkbox to see if that will help.
2) Settings Menu > In the Screensaver settings, you can uncheck the "Lockscreen after..." checkbox. Also check the Power Manager program's Extended tab for the same Lock screen checkbox.
boloog

Re: Switch user doesnt go to GDM login manager

Post by boloog »

Hi. I am having the exact same issue. The solution mentioned above doesn't seem to help. Did you get this resolved?
Thanks.

Richard
chrisonmint

Re: Switch user doesnt go to GDM login manager

Post by chrisonmint »

Hi richyrich, thanks for the suggestions.
richyrich wrote:1) System Menu > In the Preferences tab of the Login Window program, you can try unchecking the "Automatically select the last user logged in" checkbox to see if that will help.
2) Settings Menu > In the Screensaver settings, you can uncheck the "Lockscreen after..." checkbox. Also check the Power Manager program's Extended tab for the same Lock screen checkbox.
In reply to 2) I had set both of these tickboxes and it didnt help. I then resorted to removing xscreensaver.

In reply to 1) that box in unchecked. i think it only applies to the GDM screen itself (ie when showing a list of users, does it assume you are logging in as the last user to use it, or wait for you to pick)
boloog

Re: Switch user doesnt go to GDM login manager

Post by boloog »

Thanks,

I had to remove the mate-sreensaver. Removal of the mate-screensaver, also removed mint-meta-mate. The package description of mint-meta-mate says it is needed to run mate. Nevertheless i removed it. Now it works, and mate still runs. Also i don't see anything missing in mate (yet) so don't really know what this package does.
MtnDewManiac
Level 6
Level 6
Posts: 1491
Joined: Fri Feb 22, 2013 5:18 pm
Location: United States

Re: Switch user doesnt go to MDM login manager

Post by MtnDewManiac »

chrisonmint wrote:I'd really appreciate suggestions on this issue. I have a laptop running LM17.1 XFCE with 3 user accounts set up (all using Xfce as DM). Here is my issue:

Login as user 1
Switch user (takes me to the GDM login manager screen, great)
Login as user 2
Logout user 2

What I expect to happen is to go back to the GDM login manager screen, but what actually happens is I get logged into user 1's session.
From what you describe, it seems as if things are functioning as they should (which may not be the same as "functioning the way you want them to," but such is life. You were still logged in as user #1, you know.
chrisonmint wrote:When user 2 logs out, they are dumped into user 1's session and xscreensaver is asking them for user 1's password
You would prefer that the system NOT ask for a password at that point, lol?
chrisonmint wrote:and there isnt the option to get to the GDM login manager.
That, also, makes perfect sense and is logical. Why should someone be able to do anything at that point - a point when there is no certainty that the meat sitting at the computer is actually user #1? That is the point of having passwords... Enter the password and you can do anything you please (within the normal constraints, of course). If you are unable to enter it, then you are obviously NOT user #1 and, therefore, should have zero options. Yep, everything is functioning correctly :lol: .

If that does not happen to be what you want, learn to properly log out... Problem solved.
chrisonmint wrote:My kids are one of these users and its set to log them in without a password prompt, which works great from the login manager, but xscreensaver doesnt let them do that, so they get stuck.
Respectfully, most children in households that I've set up Mint linux in have been fully able to use the login/logout/password processes from age five or six. If your children are younger than that or have special needs, perhaps you should consider setting up one of the distros that are intended to be used by such people. They might get more use out of the computer that way, and it'd probably negate the need for such kludgy workarounds for non-issues as the one you mentioned in your post. OtOH, if they ARE capable of five-six year old computing skills, then... Might as well teach the kids to do things the correct way, so they don't pick up bad habits. It'll surely serve them well later in life....

Regards,
MDM
Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O'Donnell fat.
chrisonmint

Re: Switch user doesnt go to MDM login manager

Post by chrisonmint »

MtnDewManiac wrote: From what you describe, it seems as if things are functioning as they should (which may not be the same as "functioning the way you want them to," but such is life. You were still logged in as user #1, you know.
Definitely not as I would want. Its also not what would happen either on windows or OSX. I want to (for convenience) leave my session active, hit "switch user" to go to the login screen so the laptop is ready for someone else to use. That bit works, so why when the next user logs out wont it take them to the login manager?
MtnDewManiac wrote:
chrisonmint wrote:When user 2 logs out, they are dumped into user 1's session and xscreensaver is asking them for user 1's password
You would prefer that the system NOT ask for a password at that point, lol?
As the next person to use the laptop is not guaranteed to be user 1, its silly for the laptop to be asking for that users's password. My kids dont know my password (obv) or my wifes (also obv). My 6 yr old can learn to use a simple password, so can my 3 yr old... but the big issue is them needing to learn how linux "works" with the concept of multiple users etc. Sure i want them to learn all this, but there is time for that later.
MtnDewManiac wrote:
chrisonmint wrote:and there isnt the option to get to the GDM login manager.
That, also, makes perfect sense and is logical.
No, I dont think it is logical. Why would we want the laptop to be locked on a login screen for whatever user happened to be sat there before? Why does it look nothing like the login manager screen? No option to choose another user instead?
MtnDewManiac wrote: If that does not happen to be what you want, learn to properly log out... Problem solved.
Not only that, but i had to "learn" to remove xscreensaver too, so we didnt get stuck at 'wake from suspend' :roll:
MtnDewManiac wrote:If your children are younger than that or have special needs, perhaps you should consider setting up one of the distros that are intended to be used by such people.
Yes, I looked at QEMU and other distros, but all seemed to either be long-abandoned or just plain ugly. Also, this laptop was needed to work for the adults too, so I went for LM with Xfce and put on all the gcompris, abiword and tweaked the panels etc to give it a super easy layout.

It seems strange that with all the power of linux and its endless customisation, that i cant leave a session logged in for convenience without it getting in the way of other users on the machine.

MDM, is there no way of making the 'logout' Xfce buttons to always go to the login manager and not drop back to the last used session?
GuajardoMX
Level 1
Level 1
Posts: 37
Joined: Tue Apr 28, 2015 8:21 pm

Re: Switch user doesnt go to MDM login manager

Post by GuajardoMX »

I've been having the same problem as OP and I did a little workaround.

Caveat: I'm using Cinnamon and I replaced cinnamon-screensaver with xscreensaver, but I guess this would work doing the same with the appropriate command.

Switching users from the User applet of the Cinnamon panel prompts the applet.js applet (duh) found in /usr/share/cinnamon/applets/user@cinnamon.org. There, in the definition of the "Switch User" action one reads:

Code: Select all

if (GLib.getenv("XDG_SEAT_PATH")) {
                // LightDM
                this.menu.addAction(_("Switch User"), Lang.bind(this, function() {
                    Util.spawnCommandLine("cinnamon-screensaver-command --lock");
                    Util.spawnCommandLine("dm-tool switch-to-greeter");
                }));

                this.menu.addAction(_("Guest Session"), Lang.bind(this, function() {
                    Util.spawnCommandLine("cinnamon-screensaver-command --lock");
                    Util.spawnCommandLine("dm-tool switch-to-guest");
                }));
            }
            else if (GLib.file_test("/usr/bin/mdmflexiserver", GLib.FileTest.EXISTS)) {
                // MDM                
                this.menu.addAction(_("Switch User"), Lang.bind(this, function() {
                    Util.spawnCommandLine("mdmflexiserver");
                }));
            }
            else if (GLib.file_test("/usr/bin/gdmflexiserver", GLib.FileTest.EXISTS)) {
                // GDM
                this.menu.addAction(_("Switch User"), Lang.bind(this, function() {
                    Util.spawnCommandLine("cinnamon-screensaver-command --lock");
                    Util.spawnCommandLine("gdmflexiserver");
                }));
            }
I tried replacing all instances of "cinnamon-screensaver*" with the appropriate commands of xscreensaver. This didn't work (so don't do it).

So I went to /usr/bin and made a backup copy of cinnamon-screensaver and all its relatives:

Code: Select all

$ cd /usr/bin
$ ls|grep cinnamon-screensaver
cinnamon-screensaver
cinnamon-screensaver-command
cinnamon-screensaver-lock-dialog
sudo cp cinnamon-screensaver cinnamon-screensaver.bak

etcetera. Then I just replaced all cinnamon-screensaver's with xscreensaver's:

Code: Select all

cp xscreensaver cinnamon-screensaver
etc.

And that's that, the User applet now locks the screen of User 1 before switching to User 2 and keeps it locked when User 2 logs out. I hope this helps to find a more elegant solution.

Cheers!
--
Though I don't like mentholed stuff I do love Mint.
chrisonmint

Re: Switch user doesnt go to MDM login manager

Post by chrisonmint »

GuajardoMX wrote:

Code: Select all

if (GLib.getenv("XDG_SEAT_PATH")) {
                // LightDM
                this.menu.addAction(_("Switch User"), Lang.bind(this, function() {
                    Util.spawnCommandLine("cinnamon-screensaver-command --lock");
                    Util.spawnCommandLine("dm-tool switch-to-greeter");
                }));

                this.menu.addAction(_("Guest Session"), Lang.bind(this, function() {
                    Util.spawnCommandLine("cinnamon-screensaver-command --lock");
                    Util.spawnCommandLine("dm-tool switch-to-guest");
                }));
            }
            else if (GLib.file_test("/usr/bin/mdmflexiserver", GLib.FileTest.EXISTS)) {
                // MDM                
                this.menu.addAction(_("Switch User"), Lang.bind(this, function() {
                    Util.spawnCommandLine("mdmflexiserver");
                }));
            }
            else if (GLib.file_test("/usr/bin/gdmflexiserver", GLib.FileTest.EXISTS)) {
                // GDM
                this.menu.addAction(_("Switch User"), Lang.bind(this, function() {
                    Util.spawnCommandLine("cinnamon-screensaver-command --lock");
                    Util.spawnCommandLine("gdmflexiserver");
                }));
            }
Interesting way to do it - I will have a look at the Xfce logout applet in the panel to see what commands it uses on logout.

What is very interesting is to type

Code: Select all

mdmflexiserver
into a terminal. It drops you straight into the display manager login screen. Your cinnamon applet script is using cinnamon-screensaver to lock the screen, then either calling mdmflexiserver (which mint uses) or gdmflexiserver (used by other distros, mdm is a minty fork of gdm).

Maybe I need to ensure that when the Xfce 'logout' button in the panel or menu is clicked, that it calls mdmflexiserver to ensure you end up back at the login screen and not just dropped back into the previous users' session. Another thought I had was to see if mdmflexiserver could be called instead of a screensaver, so use the login screen instead of a screensaver to lock the session...

...I am not giving up yet!
MtnDewManiac
Level 6
Level 6
Posts: 1491
Joined: Fri Feb 22, 2013 5:18 pm
Location: United States

Re: Switch user doesnt go to MDM login manager

Post by MtnDewManiac »

Hey, I wanted to apologize for my previous reply. I just glanced at it and my tone might have seemed harsh.

What I was getting at was that if, instead of logging out (originally), you remained logged in and used the switch user function to allow someone else to log in, when they eventually logged out, your account is still technically logged in regardless of whether you are back at your computer or someone else is. So it seems natural - to me, I mean, lol - that the system would ask for your password before proceeding. To do otherwise might allow some unscrupulous person to somehow do other things with your account than just access the switch user dialog again.

I have noticed that in recent years Mint has added some nice options as far as login managers/screens. Some options allow for user pictures. That might help your children self-identify their individual accounts from a list. I would be surprised if your six-year old cannot easily learn to log in and log out (maybe you can configure the power button to log the user out - and go back to the login manager - instead of shutting the computer down?). However... I would have less confidence with a three-year old. I was reading at that age, but I later learned that even that is somewhat unusual - and books and newspapers are a lot easier to operate, lol. And my circumstances were a little bit of the "sink or swim" type (Dad worked away from home, Mom had retreated into her own world of grief after burying her oldest - 12-year old - son the year before... I was also managing to feed myself at that point, too, until I fried eggs and bacon and went in trying to get HER to eat it one morning which, apparently, got her... functional? IDK, it was... a difficult time for me, but she managed to get up in the morning and fix breakfast more than half the time after that...).

I see that others have chimed in; perhaps they will have something useful for you. Good luck, and thank you for raising your children - and for realizing that they are never too young to start learning.

Regards,
MDM
Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O'Donnell fat.
chrisonmint

Re: Switch user doesnt go to MDM login manager

Post by chrisonmint »

MtnDewManiac wrote:Hey, I wanted to apologize for my previous reply. I just glanced at it and my tone might have seemed harsh.
Dont worry about it
MtnDewManiac wrote: What I was getting at was that if, instead of logging out (originally), you remained logged in and used the switch user function to allow someone else to log in, when they eventually logged out, your account is still technically logged in regardless of whether you are back at your computer or someone else is. So it seems natural - to me, I mean, lol - that the system would ask for your password before proceeding. To do otherwise might allow some unscrupulous person to somehow do other things with your account than just access the switch user dialog again.
My problem, is that when clicking "log out", I would expect to always get taken back to the login screen, regardless of whether there is an active user session in the background. This is the normal behaviour on OSX and Windows.

If multiple user sessions are active then you seem to get dumped back a session chosen at random (first to log in? or last one used?)...

My kids are 3 and 6yrs, so both have learnt that "Kids" is their account, particularly after I added a picture for them. MDM allows them to log in without a password. I couldnt get xscreenserver to let them back in without a password, so that was inconsistent. When my youngest can use the keyboard, of course i will get them trained with a simple password, but until then...
chrisonmint

Re: Switch user doesnt go to MDM login manager

Post by chrisonmint »

Oh, and another thing - I can put a DVD in and it will automount nicely, but only if I am the only user logged in.

If my kids (or wife's) account is active in the background, it stops the mounting process. My kids dont have admin rights and a window pops up asking them for my password.... in their session... which is in the background!!

I have to switch users to them, put my password in and then switch users back to mine.

I dont mean to be rude, but I did expect more from a multi-user system like linux. It seems only to work nicely with one user logged in at a time.

Could this just an issue with XFCE?
chrisonmint

Re: [Partially SOLVED]Switch user doesnt go to MDM login man

Post by chrisonmint »

OK, I am changing the thread to "partially" solved as I have done the following work arounds:

1 - gnome-screensaver has a nice button on it to "switch user" so that when you get dumped onto a random other session when logging out, you can at least hit a button to take you to MDM if you are not looking at the account you want.
2 - upgrading to LM 17.2 brought an improvement to MDM so that you dont have to log in twice any more (once at MDM and once to unlock the screensaver). Thanks Mint Devs!!

I have installed dconf-editor and set the "disable-screen-lock" setting in my kids account, hopefully this will let them go straight in (no password needed on their account)
I still have the hump that logout doesnt take you always to MDM, sorry i am hard to please!

Also - I still get the problem that DVDs fail to mount if other sessions are active in the background. Any suggestions on how to fix this would be very welcome!
chrisonmint

Re: [Partially SOLVED]Switch user doesnt go to MDM login man

Post by chrisonmint »

chrisonmint wrote:I have installed dconf-editor and set the "disable-screen-lock" setting in my kids account, hopefully this will let them go straight in (no password needed on their account)
Nope, that didnt work. Going back into dconf I found another setting, Or two, actually:
(1) org.gnome.desktop.screensaver - idle-activation-enabled (set FALSE)
(this one is depracated, but i set it anyway)

(2) org.gnome.desktop.session - idle-delay (set to zero)

Fingers crossed this solves it.
Locked

Return to “Xfce”