Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

systemctl --user doesn't load on startup, even though manual 'start' works well

Writer Matthew Harrington

I have systemctl --user set up, that doesn't activate the service on startup.

$ cat .config/systemd/user/syncthing.service
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %u
Documentation=man:syncthing(1)
After=network.target
[Service]
Environment=STNORESTRART=yes
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0
Restart=on-success
[Install]
WantedBy=default.target

When I do enable - i get symlinks created:

$ systemctl --user reenable syncthing.service
Removed /home/efim/.config/systemd/user/
Created symlink /home/efim/.config/systemd/user/ → /home/efim/.config/systemd/user/syncthing.service.

But after I log into the system - the service is not running, and there are no errors in the journalctl

$ systemctl --user status syncthing.service
● syncthing.service - Syncthing - Open Source Continuous File Synchronization Loaded: loaded (/usr/lib/systemd/user/syncthing.service; enabled; vendor preset: enabled) Active: inactive (dead) Docs: man:syncthing(1)

I want to set up syncthing on startup.

Initially I used systemctl with WantedBy=multi-user.target in /etc/systemd/system/syncthing@.servicethe process was executed on startup, but failed - maybe due to not being able to access encrypted home directory

I had similar problem as one described here:

So I tried to create a --user service, but something doesn't work either. If I do systemctl --user start syncthing.service it starts and works, but nothing happens at the startup.

Please help me troubleshoot this further.

Somewhere I've seen advice to check

$ systemctl --user list-dependencies default.target
default.target
● ├─syncthing.service
● ├─ubuntu-report.path
● └─basic.target
● ├─paths.target
● ├─sockets.target
● │ ├─dbus.socket
● │ ├─dirmngr.socket
● │ ├─gpg-agent-browser.socket
● │ ├─gpg-agent-extra.socket
● │ ├─gpg-agent-ssh.socket
● │ ├─gpg-agent.socket
● │ └─snapd.session-agent.socket
● └─timers.target

Here all are green apart from syncthing.service - it is grey, looks like "no errors", just "not started"

2

1 Answer

Didn't find a proper solution.
Added commandsystemctl --user start syncthing.service to my startup hook in XMonad

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy