mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-03 16:41:26 +01:00
default.target is reached before the desktop exports DISPLAY/WAYLAND_DISPLAY to the user manager, so After=graphical-session.target never applied. The daemon's first keyring call D-Bus-activated the Secret Service without a display; on KDE ksecretd aborted, the first start failed, and every login left a coredump. Install into graphical-session.target instead, and use reenable when the front-ends enable the unit so existing default.target.wants links are replaced rather than kept alongside the new one. Fixes #23
42 lines
2.0 KiB
Desktop File
42 lines
2.0 KiB
Desktop File
[Unit]
|
|
Description=Proton Drive Files-On-Demand mount
|
|
Documentation=https://github.com/narrrl/proton-drive-linux
|
|
# Tie the mount to the desktop session: start after it is up and stop with it.
|
|
After=graphical-session.target
|
|
PartOf=graphical-session.target
|
|
|
|
[Service]
|
|
# Deliberately not Type=notify: the daemon waits for a stored login before it
|
|
# mounts anything, and a machine that boots before the user logs in would then
|
|
# fail the unit on the start timeout. NotifyAccess=all gets the daemon a
|
|
# NOTIFY_SOCKET all the same, which is all the watchdog below needs.
|
|
Type=simple
|
|
NotifyAccess=all
|
|
# The daemon waits for a stored login, mounts ~/ProtonDrive, and keeps it
|
|
# mounted. SIGTERM (from `systemctl --user stop`) triggers a clean lazy unmount.
|
|
ExecStart=/usr/bin/pdfs daemon
|
|
# Always, not on-failure: a daemon that hangs is not a failure by exit code, and
|
|
# on 2026-09-18 one had to be restarted by hand after wedging overnight.
|
|
Restart=always
|
|
RestartSec=3
|
|
# The supervisor thread pings this, but only after a round trip over the control
|
|
# socket — so a daemon that stops answering its own clients is restarted instead
|
|
# of sitting there looking alive. It pings at half this interval.
|
|
WatchdogSec=120
|
|
# Backstop against unbounded growth: the hung run peaked at 5.2G resident.
|
|
# MemoryHigh throttles and reclaims first; MemoryMax is the hard stop, above any
|
|
# legitimate working set, so it only fires on a leak.
|
|
MemoryHigh=2G
|
|
MemoryMax=6G
|
|
# Give the lazy unmount time to finish before SIGKILL.
|
|
TimeoutStopSec=15
|
|
|
|
[Install]
|
|
# Not default.target: that is reached before the desktop has exported DISPLAY /
|
|
# WAYLAND_DISPLAY to the user manager, so After= above never orders anything
|
|
# (the two targets are not in the same start transaction). The daemon's first
|
|
# keyring call then D-Bus-activates the Secret Service without a display —
|
|
# on KDE ksecretd aborts, the start fails, and every login leaves a coredump.
|
|
# Being pulled in by the graphical session starts it only once that is up.
|
|
WantedBy=graphical-session.target
|