FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GDM Default Session

    Hi

    I enabled autologin on a Fedora 21 laptop. Now, when the computer starts, it logins automatically the user I specified. The problem is that it logins using the last session the user selected, but I need the computer always logins using the same session on startup. If the user the logs off and uses another session, that's cool, but on reboot it should always start with a predefined session.

    How can i do that? using default GDM as login manager.

    Thanks!

  2. #2
    Join Date
    Nov 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GDM Default Session

    Nobody has any idea about this?

    Thanks!

  3. #3
    Join Date
    Nov 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GDM Default Session

    bump?

    thanks!

  4. #4
    Join Date
    Oct 2014
    Location
    milky way
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GDM Default Session

    A global default session can be defined in /etc/gdm/custom.conf:

    [daemon]
    DefaultSession=mate.desktop

    That said, GDM stores each user's last session in /var/lib/AccountsService/users/$USER:

    [User]
    Language=en_US.utf8
    XSession=mate
    SystemAccount=false

    I do not know of a way to configure GDM to ignore the last session used and force using a desired default with each new login. A work-around would be to run a PostSession script to always modify /var/lib/AccountsService/users/$USER.

    In /etc/gdm/PostSession/Default, try adding something like this:

    sed -i 's|^XSession=.*|XSession=mate|' /var/lib/AccountsService/users/$USER

  5. #5
    Join Date
    Nov 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GDM Default Session

    Thanks a lot for your help upnort. I'll try it and report back how it goes.

  6. #6
    Join Date
    Nov 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GDM Default Session

    Hi

    I tried what you suggested but the file does not get modified. It's like the PostSession script is not run. I tried then doing the same modification in /etc/rc.local and it modifies the file correctly, but it seems it modifies it after GDM has read it, since despite the file having the correct session, it still loads the last desktop when logging in.

    Any more ideas guys?

    Thanks!!

  7. #7
    Join Date
    Oct 2014
    Location
    milky way
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GDM Default Session

    A little over my head, but consider creating a script and a respective systemd unit file. Then instead of placing the command in rc.local, run the new systemd unit file during startup or shutdown. During startup the unit file would need to run before GDM and AccountServices and if run during shutdown then the opposite.

    According to your original post, you would want to do this to all users. As long as you use GDM you need to update all files in /var/lib/AccountsService/users/. If you use a different login manager, most still use ~/.drmc, so you would have to update all of those files. I don't know whether the key values are the same between the two file formats.

    Just asking, did you add your command to /etc/gdm/PreSession/Default? I have not been able to add multiple scripts. I have always had to edit the existing Default script to make things work.

    Another test would be:

    * Temporarily disable auto login.
    * Boot to GDM.
    * Toggle to a console.
    * Log in.
    * Edit and save the appropriate /var/lib/AccountsService/users/$USER file.
    * Toggle back to GDM.
    * Login with the appropriate account.
    * Verify the correct DE.

    That would only be a proof-of-concept test.

Similar Threads

  1. KDE As Default Session
    By raflex in forum Using Fedora
    Replies: 3
    Last Post: 5th February 2005, 08:32 PM
  2. default session
    By teghem in forum Using Fedora
    Replies: 4
    Last Post: 3rd February 2004, 03:47 PM
  3. About default gdm session
    By gunnzi in forum Using Fedora
    Replies: 0
    Last Post: 14th December 2003, 11:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •