GNOME deepens systemd dependencies
Adrian Vovk, a GNOME contributor and member of its release team, recently announced in a blog post that GNOME would be adding new dependencies on systemd, and soon. The idea is to shed GNOME's homegrown service manager in favor of using systemd, and to improve GNOME's ability to run concurrent user sessions. However, the move is also going to throw a spanner in the works for the BSDs and Linux distributions without systemd when the changes take effect in the GNOME 49 release that is set for September.
Vovk's announcement started by noting that GNOME does not have a formal, well-defined policy about systemd dependencies. The rule of thumb, he said, was that GNOME doesn't absolutely depend on systemd, but some individual features of GNOME may break without it. But there is no project-wide policy that dictates that the project should avoid depending on systemd, even though GNOME has historically been available on many non-Linux operating systems and Linux distributions that do not use systemd as their service manager.
The now-retired
GNOME wiki has a "What
We Release" page published nearly 12 years ago that explained the GNOME release
team's philosophy on dependencies and non-Linux systems clearly; the project is
focused on "a tightly-integrated desktop environment based on the GNOME Shell
running on a GNU-based operating system with a Linux kernel
". Any non-Linux
usage, such as running GNOME on a BSD, is considered a secondary concern.
Systemd, even then, was listed as a component that is encouraged but not required by GNOME. Wayland—which is soon to be the only supported display system for GNOME—is also named as a recommended (but not required) component. The page hasn't been ported to the GNOME Project Handbook that is still maintained, but GNOME's philosophy toward non-Linux usage and favoring systemd has not changed, even if it is not currently codified as a formal policy.
More systemd, fewer hacks
For about a decade, GNOME has had at least one strong dependency on systemd: its user-session manager, systemd-logind. In 2015, support for the ConsoleKit framework was completely removed in favor of systemd-logind. However, Vovk said, it is possible to use elogind—which is logind "extracted" from systemd as a standalone daemon. That made it possible for BSD distributions and others to run GNOME without systemd itself as a dependency. Now, GNOME is going to be gaining two more dependencies on systemd—and those will not be so easy to swap out. The first is systemd-userdbd, which will be used by the GNOME Display Manager (GDM).
Vovk said that GNOME and systemd do not support running more than one graphical session under a single user account—but GDM may need to display multiple login screens at once, so that multiple users can log into their own GNOME sessions on a system. So, GDM needs to start each graphical login session as a unique user.
To do this GDM has relied on "legacy behaviors and
straight-up hacks
" to provide multiple graphical sessions. Now,
GDM can use systemd-userdbd to allocate user accounts
dynamically and run each login screen as a unique user. That means
that the hacks are going away, and GDM will require
systemd-userdbd. Note that the unique users are only needed
for the login screen instance; when a user logs in, the GNOME session
runs as that user.
At some point, Vovk said, the systemd-userdbd dependency will extend further
to replace the AccountsService
daemon that GNOME uses to access user accounts and information about those
accounts. "Now that systemd's userdb enables rich user records, we can start work on
replacing AccountsService.
" Vovk said that AccountsService was meant to be a
temporary solution, but it has now been in use for 15 years. In a
discussion about the move, Rich Felker asked why a
fallback implementation couldn't just pull user data from
/etc/passwd and /etc/shadow as it had always
done. Vovk said:
For one, /etc/passwd doesn't have any form of rich information about the user. No profile pictures, no ability to export any kind of user settings to the login screen, etc. It barely has the ability to store a display name (which is actually "GECOS" instead, which is... complicated for historical reasons). Userdb is json, so we can add new stuff to it whenever we want instead of going in and implementing weird side databases.
The JSON user records used by systemd-userdbd can include many things that are not available in the GECOS field. That format, which can trace its heritage back to the early 1960s and General Electric's General Comprehensive Operating System (GECOS), is more than a bit long in the tooth. The systemd JSON user-record format, on the other hand, can not only contain more biographical information about users, it can contain additional security credentials, resource-management settings, and more.
Goodbye GNOME service manager
GNOME has had a built-in service manager since its 2.x days that can be used by gnome-session
to start and manage services. GNOME has
mostly used systemd for service management since the 3.34 release, but it kept
the built-in service manager as a fallback when systemd is unavailable—and
because the "hacks
" used by GDM for multi-seat support were incompatible with
systemd. Since those are going away, Vovk said, the built-in service manager will be
"completely unused and untested
", so it is being
removed. He said that getting rid of the legacy service manager would also make
it possible to implement a session save
and restore feature.
Vovk submitted a merge
request to remove the built-in service manager on June 6. In the discussion there,
Pablo Correa Gomez, who is a GNOME Foundation board member and has been
working on adding systemd to
PostmarketOS to make it easier to support GNOME (and KDE), said that he had
conflicting feelings about the change. Wearing his GNOME-maintainer hat, he admitted
that he had been "bitten many times before by the poor, old gnome-session
management code
". He agreed that the old code needed to go. But he
was terrified by the change as a downstream maintainer:
We, at postmarketOS are working, and getting very close to good systemd integration. But Alpine Linux and quite some others are not. Removing the built-in startup on GNOME session basically means breaking support for quite a lot of people, and giving others quite a headache. Generally speaking, I think that is not good for anybody.
He said that the change needed public communication, a call for feedback, and a
decision from the release team on the timing. He also thanked Vovk for doing the work
and necessary cleanups "not just specifically related to systemd
".
Vovk replied
that the session manager was a blocker for a feature to be included in
GNOME 49, presumably the dynamic
users for GDM greeter sessions, though he did not specify. He
noted that the announcement about the change was coming, and it would
set out exactly what would need to be implemented to use GNOME 49
without systemd. "In short, I don't think it's an unreasonable
amount of integration work.
" He also said that the removal of
GNOME's session manager had already been discussed with the release
team and approved.
In his announcement blog post, Vovk apologized for the short
timeline, but said: "this blog post could only be published after I
knew how exactly I'm splitting up gnome-session into separate launcher
and main D-Bus service processes
". One might quibble with that—certainly it's possible to announce
that a component other projects depend on might be dropped soon, even
if the exact details are not yet known. The affected parties will
usually appreciate the courtesy of a heads-up and the opportunity to
collaborate, as Gomez indicated.
What are the options for distributions that do not use systemd? Vovk suggests that
they "consider using systemd
"; failing that, they will have to implement
replacements for the systemd components as has been done with elogind. He goes into
some detail about what would be required; replacing the GNOME built-in service
manager with another, rewriting the systemd unit files to work with the
alternative service manager, as well as replacing gnome-session-ctl, which is a
utility that coordinates between GDM, the D-Bus service, and systemd. That's all
before upgrading to GNOME 49—in a future GNOME release, probably 50, non-systemd
distributions will also need to implement even more systemd-userdbd
features:
Finally: You should implement the necessary infrastructure for the userdb Varlink API to function. Once AccountsService is dropped and GNOME starts to depend more on userdb, the alternate code path will be removed from GDM.
Reactions
Alpine Linux founder Natanael Copa said that the move was
frustrating: Alpine uses musl, instead of the
GNU C Library (glibc), and musl is not currently supported by systemd. Luca Boccassi
said that systemd was
open to supporting musl as long as someone else reimplements the features musl
lacks. Copa replied
that "nobody has the time, will and skills to do the actual work, so now it looks
like we are losing GNOME
".
The Chimera Linux
distribution, which we covered in January, uses
the Dinit service
manager and musl as its C library. Its founder, Nina Kolesa, said
that she was not expecting GNOME to drop the gnome-session legacy code
now; she expected it to be dropped much earlier, "given it's pretty
much unused in everything except gdm and non-systemd
distros
". Replacing gnome-session in Chimera had been "the plan
since forever
", so GNOME's decision to drop it just hurried things
along a bit. Kolesa dismissed complaints about the decision:
The legacy handling code is kinda terrible and janky, doing away with it is a good thing overall and if your non-systemd service manager is worth anything at all, you *can* replicate the same (better) approach.
On GNOME's Discourse forum, Noé Lopez said
that he was looking into porting gnome-session to the GNU Shepherd service manager but
needed more guidance than was available in Vovk's blog post. He
understood the desire to drop old code, but collaboration was needed
to avoid dropping a huge part of GNOME's user base. GNOME contributor
Emmanuele Bassi said
that he didn't think that a huge part of GNOME's user base was running
a non-systemd-based distribution in 2025. Vovk replied
to Lopez
with a link to the merge request and invited him to reach out on the
systemd mailing list with questions about systemd-userdbd. "I'll be
happy to assist there
".
Must GNOME be portable?
GNOME embracing systemd as a required component and/or a Linux-only desktop
environment has been a recurring topic for many years now, going back to at least
2009 when Christian Schaller called
for the release team to declare GNOME "a Linux desktop system as opposed to a
desktop system for any Unix-like system
". LWN covered Bastien Nocera's plan
to make systemd a hard requirement for the power plugin in the GNOME
settings daemon in 2012.
In addition to his activities on the GNOME release team, Vovk is also a contributor
to GNOME OS, a distribution for testing and
development of the GNOME desktop. At least, that's what it is today. Vovk has written
about his vision to turn GNOME OS into an image-based "daily-drivable general purpose
OS
" with the goal of making it suitable for non-enthusiasts. Part of
that vision includes dulling the "sharp edges
" of Linux on the desktop in
favor of a GNOME OS optimized for usability. From that perspective, cutting away
the legacy bits that are needed for portability and focusing on a fully-controlled
platform makes some sense.
As "mort" said on the Lobste.rs discussion forum:
There are many great alternatives which do slot neatly into the "desktop environment" hole, most notably KDE and XFCE. These are great projects and using one of them is probably a much better idea than to try to extract only the desktop environment-like part of GNOME to get it to run outside of the intended GNOME system. Personally, I'm excited to see what the GNOME folks are able to do when unconstrained by old traditions like "everything should be a self-contained puzzle piece which can slot together with any arbitrary set of other puzzle pieces".
GNOME has been flirting with systemd as a hard requirement for a long time; perhaps it's time to make it official so that there is no expectation that GNOME is portable beyond Linux systems with systemd. That will disappoint some users, perhaps many, but other desktop projects would likely welcome them—and their non-systemd requirements—with open arms.
