Skip to content

Running as a service

For day-to-day use on a systemd-based Linux workstation, run the daemon as a systemd user service so it starts with your session and restarts on crash.

Install the binaries and the sample assets:

Terminal window
cargo install --path .
install -Dm600 examples/proton-sync.toml ~/.config/proton-sync/proton-sync.toml
install -Dm644 examples/systemd/proton-syncd.service ~/.config/systemd/user/proton-syncd.service

Or use the helper script, which installs the config at mode 0600, the unit at 0644, reloads the user manager, and won’t clobber an existing config unless you pass --force-config (add --enable/--start to enable or start it too):

Terminal window
examples/systemd/install-user-service.sh

Edit ~/.config/proton-sync/proton-sync.toml for your roots before enabling the service. The sample unit runs proton-syncd --config %h/.config/proton-sync/proton-sync.toml and relies on the daemon’s defaults — the socket under $XDG_RUNTIME_DIR, and the lockfile and index in the per-root <local-root>/.sync/ state directory.

The RPM, deb, and AUR packages ship their own unit at /usr/lib/systemd/user/proton-syncd.service (with ExecStart=/usr/bin/proton-syncd --config %h/.config/proton-sync/proton-sync.toml). You still create your config file first. The sample config’s installed location varies by package — Fedora ships it at /usr/share/doc/proton-drive-sync-engine/proton-sync.toml, Arch at /usr/share/doc/proton-drive-sync-engine/examples/proton-sync.toml, and the Debian package doesn’t ship it (use examples/proton-sync.toml from the repo). Copy whichever applies, then edit it:

Terminal window
install -Dm600 <sample-proton-sync.toml> ~/.config/proton-sync/proton-sync.toml
$EDITOR ~/.config/proton-sync/proton-sync.toml

See Native packages.

Terminal window
systemctl --user daemon-reload
systemctl --user enable --now proton-syncd.service
systemctl --user status proton-syncd.service
journalctl --user -u proton-syncd.service -f

Control it as usual — the CLI finds the default runtime socket automatically:

Terminal window
proton-sync status
  • proton-drive must be on PATH and logged in for the user the service runs as — the daemon shells it for remote file operations and reuses its keyring session for change detection. A systemd user service starts with a minimal PATH and may run before your login shell’s PATH is imported into the user manager, so a bare proton_cli = "proton-drive" can fail to resolve early in the boot session (could not run the proton-drive CLI … No such file or directory). The shipped unit pins a PATH covering the usual user bin dirs (~/.local/bin, ~/.cargo/bin, ~/bin); if your CLI lives elsewhere, set an absolute proton_cli (e.g. ~/.local/bin/proton-drive) in the config, which bypasses PATH entirely.
  • The desktop keyring must be unlocked for event-driven detection to reuse the CLI session; otherwise the daemon degrades to snapshot scans. If the keyring is still locked when the daemon starts at boot, it recovers on its own — it re-checks the keyring every pass and resumes event-driven detection once it is readable, without a restart. The unit is also ordered After=graphical-session.target so it prefers to start after the session has unlocked the keyring and imported the login PATH.
  • Only one daemon per user may run (a user-global lock enforces this) because the shared proton-drive CLI cache isn’t concurrency-safe.

To bundle the binaries plus the service assets into a distributable archive:

Terminal window
examples/packaging/build-release-archive.sh

By default it writes under target/dist; use --archive-path <PATH> to choose another location. The manifest at examples/packaging/release-assets.toml lists what a user-service distribution is expected to contain.