Hi,
The `syncthing-runit` package (from 2014) does not work for me:
- the service does not get up
- `sv start syncthing` just replies with: "timeout: down: syncthing: 0s, normally up, want up"
- the `log/run` contains a `logger` and not `svlogd`
- there is no logs at `/var/log/syncthing` to check why this is happening
I can make it run by doing `su "$USER" -c syncthing` but I guess this is "bad".
So my questions are:
- does this happens with anyone else?
- what is the difference between `chpst -u "$USER"` and `su "$USER"`?
- how do I get the logs from this service without altering anything?
For the record:
the `run` original content is the following:
```sh
#!/bin/sh
[ -r conf ] && . ./conf
exec 2>&1
exec chpst -u "$USER" syncthing -logflags 0
```
the `log/run`original content is the following:
```sh
#!/bin/sh
exec logger -t syncthing
```
Thank you
Continuing my research:
- `su` has basically the same effect as `chpst`, but also sets the user variables
- of course one can remove the `exec 2>&1` to get the print
- running the `syncthing/run` directly is of course also possible
- Syncthing seems to be having trouble with the $HOME variable, even if I set it directly on the `syncthing/conf` (this explains why su works). it prints "$HOME is not defined" if I pipe the `--verbose` output to a file and call `sv`
- Setting the `--home` option according to the `man` also resulted in failure
- When `ps aux | grep syncthing`, I noticed the following: "root 855 0.1 0.0 2564 1316 ? Ss 21:32 0:00 runsvdir -P /run/runit/service log: ocations.init.0() ?github.com/syncthing/syncthing/lib/locations/locations.go:59 +0x17 panic: Failed to get user home dir goroutine 1 [running]: github.com/syncthing/syncthing/lib/locations.userHomeDir() ?github.com/syncthing/syncthing/lib/locations/locations.go:279 +0x78 github.com/syncthing/syncthing/lib/locations.init.0() ?github.com/syncthing/syncthing/lib/locations/locations.go:59 +0x17"
- This lead me to this closed MR: https://github.com/syncthing/syncthing/issues/8784