On 16/07/2024 10:39, Greg Wooledge wrote:
On Tue, Jul 16, 2024 at 09:58:20 +0700, Max Nikulin wrote:
cat ~/.config/systemd/user/service.d/umask.conf
[Service]
UMask=0007

I googled "how to create a systemd user service" and got

The following blog posts (0pointer.de) may be a bit outdated, but still useful:
https://systemd.io/#the-systemd-for-administrators-blog-series

hobbit:~/.config$ cat systemd/user/xterm.service

I am a bit afraid that corner cases might exist because there are no .service files for applications started from menus and runners

systemd-cgls

├─user.slice (#361)
│ └─user-1000.slice (#6090)
│   ├─user@1000.service … (#6182)
│   │ ├─session.slice (#6320)
│   │ ├─app.slice (#6274)
...
│   │ │ ├─app-org.kde.konsole-dfb8….scope (#8087)
│   │ │ │ ├─ 2572 /usr/bin/konsole
...
│   │ │ ├─app-debian\x2dxterm-e15c….scope (#14192)
│   │ │ │ ├─25859 /usr/bin/xterm

systemd --user process inherits my $DISPLAY

You may use

systemctl --user show-environment

[Service]
Environment="FOO=%h/test123" "BAR=b a r"

I do not remember if environment.d(5) has some issues that may be avoided this way.

I'm assuming the two files in service.d/ can be merged, but I didn't
test that.

Certainly, however sometimes it is more convenient to manage independent drop-ins.


So, this is a highly positive result.  (And surprising.  Why isn't this
stuff documented in ALL the places??)

Man pages for systemd is so long that sometimes it is easy to miss something important. Sometimes systemd.index(7) and systemd.directives(7) are not enough to find a specific topic.

Perhaps I have noticed service.d trick in output of "sustemctl cat" for some service.

systemd.unit(5):
Top level per-type drop-ins can be used to change some aspect of all
units of a particular type. For example by creating the
/etc/systemd/system/service.d/ directory with a drop-in file,

Greg Wooledge wrote:
Now we just need for GNOME users to discover a way to configure the
programs that are started as children of dbus, and then we can move
forward.

I do not have a recent live image on my disk to verify, but I expect that nowadays Gnome uses systemd session as well. Desktop environments that have not migrated to systemd likely still relies on Xsession.

Reply via email to