Skip to main content


I was puzzled on why #syncthing on my laptop was showing "2021-06-02" as last synchronization date with my #raspberrypi.
So I logged in my raspi via ssh, and magically the two devices started to sync.
A quick look at the raspberrpi's journal (# journalctl --since=today) showed:
ago 02 17:22:20 raspberrypi systemd[32888]: pam_unix(systemd-user:session): session opened for user pi(uid=1000) by (uid=0)
[...]
ago 02 17:22:21 raspberrypi syncthing[32908]: [start] INFO: syncthing v1.12.1-ds1 "Fermium Flea" (go1.15.9 linux-arm64) debian@debian 2021-04-08 21:52:00 UTC

🤦
I had setuped Syncthing to start with a user #systemd service unit, so the service was running only when user had log in and was stopped when the user logs out!

I want the synced files to be own by the user, so I have to run Synchthing from a system unit, but as my user. Now.. I could copy the user service file and set up a system service file from there but.... the kind developers of Syncthing have done that for us already!

It's been a matter of

$ systemctl --user disable syncthing.service --now
$ sudo systemctl enable synching@pi.service --now

where pi is the user Synching will run as... nice!
yup. is a systemd session started from scratch by pam when the user logs in for the first time.

see https://wiki.archlinux.org/title/Systemd/User

This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website.