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

Place dunst.service in session.slice #1397

Merged
merged 1 commit into from
Nov 28, 2024
Merged

Conversation

Atemu
Copy link
Contributor

@Atemu Atemu commented Nov 11, 2024

By default, systemd would place it in app.slice which doesn't make sense; that's where apps go, not daemons that are part of the desktop session.

session.slice makes a lot more sense for a daemon that's part of the desktop session.

Related: flatpak/xdg-desktop-portal-gtk#504

By default, systemd would place it in `app.slice` which doesn't make sense;
that's where apps go, not daemons that are part of the desktop session.

`session.slice` makes a lot more sense for a daemon that's part of the desktop
session.
Atemu added a commit to Atemu/nixos-config that referenced this pull request Nov 11, 2024
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.14%. Comparing base (43e3ac0) to head (6c4814e).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1397   +/-   ##
=======================================
  Coverage   65.14%   65.14%           
=======================================
  Files          50       50           
  Lines        8651     8651           
  Branches     1022     1022           
=======================================
  Hits         5636     5636           
  Misses       3015     3015           
Flag Coverage Δ
unittests 65.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bynect
Copy link
Member

bynect commented Nov 11, 2024

Could you link some docs about the slice option? I found this https://www.freedesktop.org/software/systemd/man/latest/systemd.slice.html where it says

By default, service and scope units are placed in system.slice, virtual machines and containers registered with systemd-machined(8) are found in machine.slice, and user sessions handled by systemd-logind(8) in user.slice. See systemd.special(7) for more information

Maybe I am misinterpreting this but shouldn't the service be added by default to system.slice?

Atemu added a commit to Atemu/nixos-config that referenced this pull request Nov 12, 2024
@Atemu
Copy link
Contributor Author

Atemu commented Nov 12, 2024

The upstream docs are confusing on this but this is a user service, not a system service. I could not find it documented but user services appear to be placed in app.slice by default.

@bynect
Copy link
Member

bynect commented Nov 12, 2024

I found this https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html
which mentions user.slice and session.slice
The docs of systemd really are 💩 though

@bynect
Copy link
Member

bynect commented Nov 28, 2024

I have checked a systemd system and the session.slice is used for things like pulseaudio. which is fine for this pr.

My only question at this moment is why is dbus in app.slice?

@Atemu
Copy link
Contributor Author

Atemu commented Nov 28, 2024

It isn't for me. I use the dbus-broker implementation though:

$ scu cat dbus.service 
# /etc/systemd/user/dbus-broker.service
[Unit]
Description=D-Bus User Message Bus
Documentation=man:dbus-broker-launch(1)
DefaultDependencies=false
After=dbus.socket
Before=basic.target shutdown.target
Requires=dbus.socket
Conflicts=shutdown.target

[Service]
Type=notify
Sockets=dbus.socket
ExecStart=/nix/store/2zi5iw7p7hvgc4vryfhr6caj19mbnk3q-dbus-broker-36/bin/dbus-broker-launch --scope user
ExecReload=/nix/store/7bvzsk07az1d9hnpy9d5cpvnizbzmdcd-systemd-256.7/bin/busctl --user call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus ReloadConfig
Slice=session.slice

[Install]
Alias=dbus.service

# /nix/store/djigkrxi03y95ab4whkr607snwkwxpia-user-units/dbus-broker.service.d/overrides.conf
[Unit]
X-Restart-Triggers=/nix/store/0nifcbjr1ps3p08rvcggpprny9415110-X-Restart-Triggers-dbus-broker

[Service]
Environment="LOCALE_ARCHIVE=/nix/store/b8bmyz7mkfvvlrrrbr2py9b7wlv4xjbh-glibc-locales-2.40-36/lib/locale/locale-archive"
Environment="PATH=/nix/store/sf6y4arqcm100rnnl3dhpg732i774zp6-coreutils-9.5/bin:/nix/store/psjqqbj19n3fqssn38hgz4cv7b7a9alp-findutils-4.10.0/bin:/nix/store/nysgss3ggh3dv7mz08n28h29l>
Environment="TZDIR=/nix/store/5z7yfmp96ijpx0lhy5gpj65i38972330-tzdata-2024b/share/zoneinfo"
X-ReloadIfChanged=true

@bynect
Copy link
Member

bynect commented Nov 28, 2024

Well I will go ahed and merge then

@bynect bynect merged commit 0d89935 into dunst-project:master Nov 28, 2024
21 checks passed
@Atemu Atemu deleted the patch-1 branch November 28, 2024 20:41
@Atemu
Copy link
Contributor Author

Atemu commented Nov 28, 2024

Thanks!

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.

3 participants