I created service for strelaysvr:
[Unit]
Description=Syncthing Relay Server
After=network.target
[Service]
ExecStart=/usr/bin/strelaysrv -keys /srv/strelaysrv/keys
User=strelaysrv
[Install]
WantedBy=multi-user.target
and placed it into /srv/strelaysvr/strelaysvr.service, which I symlinked into /etc/systemd/system.
Then went on and systemctl enabled it , systemctl started it, and all works, fine, until reboot: after that, it seems to "disappear":
root@here:~# systemctl start strelaysrv
Failed to start strelaysrv.service: Unit strelaysrv.service not found.
root@here:~# ll /etc/systemd/system/strelaysrv.service
lrwxrwxrwx 1 root root 34 Apr 2 22:59 /etc/systemd/system/strelaysrv.service -> /srv/strelaysrv/strelaysrv.service
root@here:~# ll /etc/systemd/system/multi-user.target.wants/strelaysrv.service
lrwxrwxrwx 1 root root 34 Apr 2 23:00 /etc/systemd/system/multi-user.target.wants/strelaysrv.service -> /srv/strelaysrv/strelaysrv.service
root@here:~# ll /srv/strelaysrv/strelaysrv.service
-rw-r--r-- 1 root root 185 Apr 2 22:58 /srv/strelaysrv/strelaysrv.service
But just calling systemctl enable succeeds and I can start it again! What am I doing wrong? Am I hitting a systemd bug?
root@here:~# lsb_release -a |& grep escr
Description: Debian GNU/Linux 9.4 (stretch)
root@here:~# dpkg -s systemd | grep ersion
Version: 232-25+deb9u3
After=multi-user.targetsystemctl enable, so the ownership is right./srvmounted when systemd tries to load the .service file at boot?UUID=redacted /home ext4 defaults 0 0in fstab. (My apache vhosts do rely on /srv, nothing except strelaysrv has unit file there, though.)