I’ve already used syncthing with systemd without problems. But I’ve bought a new computer and decided to use home directory encryption so I need to start synthing as user service after login. And I’am unable to do it. I’ve tried
systemctl --user enable syncthing.service
as mentioned in syncthing documentation. It successfully created link in ~/.config/systemd/user/default.target.wants. I can run sycthing manually with systemctl start command. But it never starts automatically.
After some inspection I found, that, despite of theese links, syncthing is missing from default.target dependencies when I try to list them with list-dependencies systemctl command. Which is the problem, probably. I don’t know how to fix it hovever.
What I’am doing wrong? Besides lack of experience with systemd
What does systemctl --user status syncthing.service say? And please excuse the question, I am asking everything that comes to mind and wasn’t mentioned explicitly: You did use --user when using list-dependencies, right? Also if the status logs are filled with the manual start, you can check logs from after login with journalctl --user -u syncthing.
Weird that the -u parameter doesn’t work with --user, no idea why. But the service is enabled, so it should just work. You can have a look at just journalctl --user, but I don’t know what to look for.
Note that in general this is supposed to work. In fact, here on my machine (Arch Linux) it works fine:
journalctl --user -fu syncthing
-- Logs begin at Tue 2017-06-06 19:32:02 CEST. --
Dez 07 22:30:14 martchus-arch syncthing[626]: [HP76R] INFO: Completed initial scan of readwrite folder music
...
However, I remember someone mentioning the same problem (no log for --user services) on IRC. Not sure what the solution was.
Stupid question, but did you execute all commands with the correct user? For example, if you accidentally call systemctl --user enable syncthing.service as root, the service will not be enabled for your regular user.
Which dependencies are missing according to systemctl list-dependencies --user syncthing?