Score:2

Updates to GNOME always cause breakage due to Smartcard settings not being available

ru flag

So, this is a headache when you use Yubikeys or smartcards, but to disable Smartcard support in GUI, you have to remove it from the session environments.

Unfortunately, this causes some headaches, as even if you follow instructions such as those in this question's answers, package updates can occasionally overwrite /usr/share/gnome-session/sessions/gnome-login.session and /usr/share/gnome-session/sessions/ubuntu.session which undo those changes. This bit me in the butt today and it took nearly an hour and a half for me to debug this and get back to a usable state on my 22.04 system.

My solution as an insane power user was to create a SystemD unit needed before graphical.target and forcibly removes the org.gnome.SettingsDaemon.Smartcard references in both files as a perpetual fix during the boot process, but I'm wondering if there's a way to override the session referred to in the boot process so I don't have to alter the files that're overwritten during some updates.

Where does the system get its definitions of what session file to use in sessions, and is it possible for me to override it so that it loads a custom .session file always that will NEVER have the lines that I need to remove in it, thereby not having to go with my 'power user' approach?

Score:1
ru flag

I got an answer from IRC that I think will work, and it involves the use of dpkg-divert.

Essentially, dpkg-divert can hold local rules such that when a specific file is going to be overwritten by a package, I can tell it to store the file elsewhere.

To that end...

sudo dpkg-divert --divert /usr/share/gnome-session/sessions/gnome-login.session.dist --rename /usr/share/gnome-session/sessions/gnome-login.session

... is the command that I was given to use. It redirects /usr/share/gnome-session/sessions/gnome-login.session writes to /usr/share/gnome-session/sessions/gnome-login.session.dist instead, thereby retaining my login session settings so my system doesn't explode.

From there, I simply make a copy of gnome-login.session.dist as gnome-login.session and the system will no longer overwrite the file I'm wanting to keep the same from update to update, while it will continue to keep gnome-login.session with my changes (in theory).

Thank you to IRC chat for the solution for this!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.