Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use systemd instead of gnome-session's builtin session management #31

Merged
merged 12 commits into from
May 4, 2024

Conversation

SoumyaRanjanPatnaik
Copy link
Contributor

@SoumyaRanjanPatnaik SoumyaRanjanPatnaik commented Apr 21, 2024

gnome-session removes the --builtin and --systemd flags with v46 . The default behaviour now requires the sessions to use systemd.

Fixes regolith-linux/regolith-desktop#1001

Requires regolith-linux/regolith-wm-config#24

@SoumyaRanjanPatnaik
Copy link
Contributor Author

SoumyaRanjanPatnaik commented Apr 21, 2024

The sway session works with this patch on matic. I can't say the same for the X11 session (it's broken for some unknown reason on my system).

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

Impressive work @SoumyaRanjanPatnaik . Do you think this will remain backwards compatible to debian bullseye and ubuntu focal?

@SoumyaRanjanPatnaik
Copy link
Contributor Author

It should, as long as the version gnome-session that ships with debian bullseye and ubuntu focal support systemd.

kgilmer pushed a commit to regolith-linux/voulage that referenced this pull request Apr 21, 2024
@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Although I did like your refactor of the session files. It simplifies the session files and is way cleaner. We can probably merge the two branches.

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

I'm working on this today because I decided to upgrade my dev machine to 24.04 and things didn't go so well. 🤣

I've tested my version in that the i3 and sway desktops load from gdm3. There is some weirdness related to the session tho for things like logout, reboot, etc.. I'm guessing your systemd approach is the cleaner and more maintainable refactor. Will do some testing.

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

Unable to reach sway desktop from login after installing regolith-wm-config 4.5.0 and regolith-session 1.1.0. Seeing this in my syslog file:

2024-04-20T18:18:46.513769-07:00 lopi systemd[5543]: Starting [email protected] - GNOME Session Manager (session: regolith-wayland)...
2024-04-20T18:18:46.544308-07:00 lopi gnome-keyring-d[6673]: The PKCS#11 component was already initialized
2024-04-20T18:18:46.544468-07:00 lopi gnome-keyring-pkcs11.desktop[6788]: discover_other_daemon: 1GNOME_KEYRING_CONTROL=/run/user/1000/keyring
2024-04-20T18:18:46.545600-07:00 lopi gnome-session[6768]: gnome-session-binary[6768]: GnomeDesktop-WARNING: Could not create transient scope for PID 6781: GDBus.Error:org.freedesktop.DBus.Error.UnixPro
cessIdUnknown: Failed to set unit properties: No such process
2024-04-20T18:18:46.545636-07:00 lopi gnome-session-binary[6768]: GnomeDesktop-WARNING: Could not create transient scope for PID 6781: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Failed
 to set unit properties: No such process
2024-04-20T18:18:46.546775-07:00 lopi gnome-keyring-ssh.desktop[6793]: discover_other_daemon: 1GNOME_KEYRING_CONTROL=/run/user/1000/keyring
2024-04-20T18:18:46.546787-07:00 lopi gnome-keyring-ssh.desktop[6793]: SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
2024-04-20T18:18:46.547679-07:00 lopi gnome-keyring-d[6673]: The Secret Service was already initialized
2024-04-20T18:18:46.547814-07:00 lopi gnome-keyring-secrets.desktop[6798]: discover_other_daemon: 1GNOME_KEYRING_CONTROL=/run/user/1000/keyring
2024-04-20T18:18:46.547826-07:00 lopi gnome-keyring-secrets.desktop[6798]: SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
2024-04-20T18:18:46.563110-07:00 lopi systemd[5543]: app-gnome-gnome\x2dkeyring\x2dsecrets-6790.scope: Couldn't move process 6790 to requested cgroup '/user.slice/user-1000.slice/[email protected]/app.s
lice/app-gnome-gnome\x2dkeyring\x2dsecrets-6790.scope': No such process
2024-04-20T18:18:46.563151-07:00 lopi systemd[5543]: app-gnome-gnome\x2dkeyring\x2dsecrets-6790.scope: Failed to add PIDs to scope's control group: No such process
2024-04-20T18:18:46.563173-07:00 lopi systemd[5543]: app-gnome-gnome\x2dkeyring\x2dsecrets-6790.scope: Failed with result 'resources'.
2024-04-20T18:18:46.563257-07:00 lopi systemd[5543]: Failed to start app-gnome-gnome\x2dkeyring\x2dsecrets-6790.scope - Application launched by gnome-session-binary.
2024-04-20T18:18:46.563685-07:00 lopi systemd[5543]: app-gnome-gnome\x2dkeyring\x2dssh-6784.scope: PID 6784 vanished before we could move it to target cgroup '/user.slice/user-1000.slice/[email protected]
ce/app.slice/app-gnome-gnome\x2dkeyring\x2dssh-6784.scope', skipping: No such process
2024-04-20T18:18:46.563707-07:00 lopi systemd[5543]: app-gnome-gnome\x2dkeyring\x2dssh-6784.scope: No PIDs left to attach to the scope's control group, refusing.
2024-04-20T18:18:46.563724-07:00 lopi systemd[5543]: app-gnome-gnome\x2dkeyring\x2dssh-6784.scope: Failed with result 'resources'.
2024-04-20T18:18:46.563809-07:00 lopi systemd[5543]: Failed to start app-gnome-gnome\x2dkeyring\x2dssh-6784.scope - Application launched by gnome-session-binary.
2024-04-20T18:18:46.564003-07:00 lopi systemd[5543]: Started [email protected] - GNOME Session Manager (session: regolith-wayland).
2024-04-20T18:18:46.564631-07:00 lopi gnome-session[6768]: gnome-session-binary[6768]: GnomeDesktop-WARNING: Could not create transient scope for PID 6802: GDBus.Error:org.freedesktop.DBus.Error.UnixPro
cessIdUnknown: Failed to set unit properties: No such process
2024-04-20T18:18:46.564651-07:00 lopi gnome-session-binary[6768]: GnomeDesktop-WARNING: Could not create transient scope for PID 6802: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Failed
 to set unit properties: No such process
2024-04-20T18:18:46.564906-07:00 lopi systemd[5543]: Started app-gnome-at\x2dspi\x2ddbus\x2dbus-6800.scope - Application launched by gnome-session-binary.
2024-04-20T18:18:46.564930-07:00 lopi systemd[5543]: Reached target gnome-session-manager.target - GNOME Session Manager is ready.
2024-04-20T18:18:46.565224-07:00 lopi systemd[5543]: regolith-wayland.service: Failed to load environment files: No such file or directory
2024-04-20T18:18:46.565245-07:00 lopi systemd[5543]: regolith-wayland.service: Failed to spawn 'start' task: No such file or directory
2024-04-20T18:18:46.565314-07:00 lopi systemd[5543]: regolith-wayland.service: Failed to load environment files: No such file or directory
2024-04-20T18:18:46.565331-07:00 lopi systemd[5543]: regolith-wayland.service: Failed to spawn 'stop-post' task: No such file or directory
2024-04-20T18:18:46.565359-07:00 lopi systemd[5543]: regolith-wayland.service: Failed with result 'resources'.
2024-04-20T18:18:46.565455-07:00 lopi systemd[5543]: Failed to start regolith-wayland.service - Regolith Session on sway.
2024-04-20T18:18:46.565474-07:00 lopi systemd[5543]: regolith-wayland.service: Triggering OnFailure= dependencies.
2024-04-20T18:18:46.565708-07:00 lopi systemd[5543]: Stopped update-notifier-crash.path - Path trigger for Apport crash notifications.
2024-04-20T18:18:46.570097-07:00 lopi systemd[5543]: Stopped update-notifier-release.path - Path trigger for new release of Ubuntu notifications.
2024-04-20T18:18:46.570119-07:00 lopi systemd[5543]: Stopped target gnome-session-wayland.target - GNOME Wayland Session.
2024-04-20T18:18:46.570228-07:00 lopi systemd[5543]: Stopping gvfs-afc-volume-monitor.service - Virtual filesystem service - Apple File Conduit monitor...
2024-04-20T18:18:46.570321-07:00 lopi systemd[5543]: Stopping gvfs-daemon.service - Virtual filesystem service...
2024-04-20T18:18:46.570407-07:00 lopi systemd[5543]: Stopping gvfs-goa-volume-monitor.service - Virtual filesystem service - GNOME Online Accounts monitor...
2024-04-20T18:18:46.570484-07:00 lopi systemd[5543]: Stopping gvfs-gphoto2-volume-monitor.service - Virtual filesystem service - digital camera monitor...
2024-04-20T18:18:46.570549-07:00 lopi systemd[5543]: Stopping gvfs-mtp-volume-monitor.service - Virtual filesystem service - Media Transfer Protocol monitor...
2024-04-20T18:18:46.570617-07:00 lopi systemd[5543]: Stopping gvfs-udisks2-volume-monitor.service - Virtual filesystem service - disk device monitor...
2024-04-20T18:18:46.570644-07:00 lopi systemd[5543]: Stopped target gnome-session-manager.target - GNOME Session Manager is ready.
2024-04-20T18:18:46.570668-07:00 lopi systemd[5543]: Stopped target regolith-wayland.target - Regolith on wayland.
2024-04-20T18:18:46.570775-07:00 lopi systemd[5543]: Stopping [email protected] - GNOME Session Manager (session: regolith-wayland)...
2024-04-20T18:18:46.570800-07:00 lopi systemd[5543]: upgrade-restore-font.service - Restore font after upgrade was skipped because of an unmet condition check (ConditionPathExists=/home/kgilmer/.config/
upgrade-need-font-restore).
2024-04-20T18:18:46.570838-07:00 lopi systemd[5543]: Stopping xdg-document-portal.service - flatpak document portal service...
2024-04-20T18:18:46.570988-07:00 lopi tracker-miner-f[6102]: Owner of volume monitor org.gtk.vfs.AfcVolumeMonitor disconnected from the bus; removing drives/volumes/mounts
2024-04-20T18:18:46.571027-07:00 lopi systemd[5543]: Stopping xdg-permission-store.service - sandboxed app permission store...
2024-04-20T18:18:46.571088-07:00 lopi tracker-miner-f[6102]: Owner of volume monitor org.gtk.vfs.GoaVolumeMonitor disconnected from the bus; removing drives/volumes/mounts
2024-04-20T18:18:46.571125-07:00 lopi tracker-miner-f[6102]: Owner of volume monitor org.gtk.vfs.MTPVolumeMonitor disconnected from the bus; removing drives/volumes/mounts
2024-04-20T18:18:46.571204-07:00 lopi tracker-miner-f[6102]: Owner of volume monitor org.gtk.vfs.GPhoto2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts
2024-04-20T18:18:46.571364-07:00 lopi systemd[5543]: Stopped gvfs-mtp-volume-monitor.service - Virtual filesystem service - Media Transfer Protocol monitor.
2024-04-20T18:18:46.571667-07:00 lopi at-spi-dbus-bus.desktop[6800]: Failed to launch bus: Bus exited with code 0
2024-04-20T18:18:46.571708-07:00 lopi systemd[5543]: Stopped gvfs-gphoto2-volume-monitor.service - Virtual filesystem service - digital camera monitor.
2024-04-20T18:18:46.571853-07:00 lopi systemd[5543]: Stopped gvfs-afc-volume-monitor.service - Virtual filesystem service - Apple File Conduit monitor.
2024-04-20T18:18:46.574078-07:00 lopi systemd[5543]: Stopped gvfs-goa-volume-monitor.service - Virtual filesystem service - GNOME Online Accounts monitor.
2024-04-20T18:18:46.574162-07:00 lopi systemd[1]: run-user-1000-gvfs.mount: Deactivated successfully.
2024-04-20T18:18:46.574308-07:00 lopi systemd[5543]: Stopped xdg-permission-store.service - sandboxed app permission store.
2024-04-20T18:18:46.574476-07:00 lopi systemd[5543]: Stopped gvfs-daemon.service - Virtual filesystem service.
2024-04-20T18:18:46.582244-07:00 lopi tracker-miner-f[6102]: Owner of volume monitor org.gtk.vfs.UDisks2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts
2024-04-20T18:18:46.582424-07:00 lopi systemd[5543]: Stopped gvfs-udisks2-volume-monitor.service - Virtual filesystem service - disk device monitor.
2024-04-20T18:18:46.588623-07:00 lopi systemd[5543]: Stopped [email protected] - GNOME Session Manager (session: regolith-wayland).
2024-04-20T18:18:46.588683-07:00 lopi systemd[5543]: Stopped target gnome-session-pre.target - Tasks to be run before GNOME Session starts.
2024-04-20T18:18:46.588707-07:00 lopi systemd[5543]: Stopped target graphical-session-pre.target - Session services which should run early before the graphical session is brought up.
2024-04-20T18:18:46.588726-07:00 lopi systemd[5543]: Reached target gnome-session-shutdown.target - Shutdown running GNOME Session.
2024-04-20T18:18:46.588780-07:00 lopi systemd[5543]: Stopping gnome-session-monitor.service - Monitor Session leader for GNOME Session...
2024-04-20T18:18:46.589320-07:00 lopi systemd[5543]: Starting gnome-session-restart-dbus.service - Restart DBus after GNOME Session shutdown...
2024-04-20T18:18:46.589594-07:00 lopi systemd[5543]: Stopped target gnome-session-shutdown.target - Shutdown running GNOME Session.
2024-04-20T18:18:46.590163-07:00 lopi systemd[5543]: Stopped gnome-session-monitor.service - Monitor Session leader for GNOME Session.
2024-04-20T18:18:46.593312-07:00 lopi systemd[5543]: Started gnome-session-restart-dbus.service - Restart DBus after GNOME Session shutdown.
2024-04-20T18:18:46.594566-07:00 lopi gdm3: Gdm: GdmDisplay: Session never registered, failing

I've only built the package for noble in the unstable stage. Anything look off in the logs @SoumyaRanjanPatnaik ?

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Can you check the output of systemctl status --user regolith-wayland.service

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Also I was having to reboot for the first time.

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

Can you check the output of systemctl status --user regolith-wayland.service

I am running the default ubuntu session, in case it matters..

systemctl status --user regolith-wayland.service
○ regolith-wayland.service - Regolith Session on sway
     Loaded: loaded (/usr/lib/systemd/user/regolith-wayland.service; static)
     Active: inactive (dead)

Apr 20 18:18:04 lopi systemd[5543]: regolith-wayland.service: Failed with result 'resources'.
Apr 20 18:18:04 lopi systemd[5543]: Failed to start regolith-wayland.service - Regolith Session on sway.
Apr 20 18:18:04 lopi systemd[5543]: regolith-wayland.service: Triggering OnFailure= dependencies.
Apr 20 18:18:46 lopi systemd[5543]: regolith-wayland.service: Failed to load environment files: No such file or directory
Apr 20 18:18:46 lopi systemd[5543]: regolith-wayland.service: Failed to spawn 'start' task: No such file or directory
Apr 20 18:18:46 lopi systemd[5543]: regolith-wayland.service: Failed to load environment files: No such file or directory
Apr 20 18:18:46 lopi systemd[5543]: regolith-wayland.service: Failed to spawn 'stop-post' task: No such file or directory
Apr 20 18:18:46 lopi systemd[5543]: regolith-wayland.service: Failed with result 'resources'.
Apr 20 18:18:46 lopi systemd[5543]: Failed to start regolith-wayland.service - Regolith Session on sway.
Apr 20 18:18:46 lopi systemd[5543]: regolith-wayland.service: Triggering OnFailure= dependencies.

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Alright I know the issue.

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

Also I was having to reboot for the first time.

Verified no change (fail state) after reboot

@SoumyaRanjanPatnaik
Copy link
Contributor Author

regolith-wayland.service: Failed to load environment files: No such file or directory

I had added support for configuring custom environments using systemd. Its probably searching for the env file at .config/regolith3/sway/env

ExecStart=regolith-session-wayland

# Setup custom environment for session
EnvironmentFile=%h/.config/regolith3/sway/env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this guy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Just pushed a fix

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Should be fixed now

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

Should be fixed now

build attempt: https://github.com/regolith-linux/voulage/actions/runs/8769279314

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

Verified fix. I am able to reach both i3 and sway desktops w/ regolith-session 1.1.1 and don't notice the session weirdness on X11 as with my changes. Let's make this the primary change. There are a few things that need to be tweaked, and I'll look at integration any relevant changes on top of this. Nice work @SoumyaRanjanPatnaik !

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Thanks :). Kinda surprised there aren't any issues with the X11 session. In my experience the startup and logout time has improved significantly as well.

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Lmk if you need help with anything. I have some time on my hands this weekend.

kgilmer pushed a commit to regolith-linux/voulage that referenced this pull request Apr 21, 2024
@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

Lmk if you need help with anything. I have some time on my hands this weekend.

Nice :) I'll be testing, working towards a first beta of 3.2 to (hopefully) closely follow the upstream Ubuntu release. So, any docs that need to be added or specific things to test, last minute tweaks for 3.2...now is the time.

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

unstable stage now has this change. Verified debian testing able to reach desktop on both sway and i3.

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Just wondering. Do we finally promote Wayland to stable?

@SoumyaRanjanPatnaik
Copy link
Contributor Author

I'm also thinking of always starting sway with the --unsupported-gpu flag. All it does is crash the session when the graphics card isn't officially supported. But this seems to be the top issue on the Wayland session.

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

Just wondering. Do we finally promote Wayland to stable?

SGTM!

I'm also thinking of always starting sway with the --unsupported-gpu flag. All it does is crash the session when the graphics card isn't officially supported. But this seems to be the top issue on the Wayland session.

Is there no downside? (there's always a downside)

@kgilmer
Copy link
Member

kgilmer commented Apr 21, 2024

Can you quickly check the sitch with regolith-linux/regolith-wm-config#14 given this systemd change @SoumyaRanjanPatnaik ?

@SoumyaRanjanPatnaik
Copy link
Contributor Author

There's a chance they even the contents of usr/share/regolith/sway/config.d/95_dbus-activation mat not be required anymore given the session is started using systemd

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Is there no downside? (there's always a downside)

Seems like it. My laptop uses AMD graphics with the open source drivers.(Supported). I recently realised that I've had this option enabled for the past one year. Haven't had any problems.

@SoumyaRanjanPatnaik
Copy link
Contributor Author

The only downside might be us having to deal with display flickering/no output issues, which are actually due to the lack of NVidia support on sway.

But keeping NVidia behind a flag that users don't know exists already brings up at least as many issues, if not more.

@SoumyaRanjanPatnaik
Copy link
Contributor Author

Just wondering. Do we finally promote Wayland to stable?

SGTM!

We can create another "Call for features and issues" discussion to get a definitive idea of whether users are having a good experience or not.

@kgilmer kgilmer merged commit 0fcc65d into main May 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regolith still passes --builtin to gnome-session-binary which is not supported anymore.
2 participants