Просмотр исходного кода

Fix syncthing process reparenting with runit

When you: `sudo sv down /etc/service/syncthing/` the `TERM` signal
isn't propogated or trapped, so syncthing is orphaned and adopted by
init (PID 1).

- Changed call to `chpst` to `exec`
- Moved logging to `log/run` per `runsv` standard
Colin Kennedy 11 лет назад
Родитель
Сommit
eaf71db7c9
3 измененных файлов с 8 добавлено и 2 удалено
  1. 2 1
      etc/linux-runit/README.md
  2. 4 0
      etc/linux-runit/log/run
  3. 2 1
      etc/linux-runit/run

+ 2 - 1
etc/linux-runit/README.md

@@ -9,7 +9,8 @@ other platforms also using runit.
     recommended to place it in a directory writeable by the running user
     so that automatic upgrades work.
 
- 3. Copy the edited `run` file to `/etc/service/syncthing/run`.
+ 3. Copy this directory (containing the edited `run` file and `log` folder) to
+    `/etc/service/syncthing`.
 
 Log output is sent to syslogd.
 

+ 4 - 0
etc/linux-runit/log/run

@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec logger -t syncthing
+

+ 2 - 1
etc/linux-runit/run

@@ -4,5 +4,6 @@ export USERNAME=jb
 export HOME="/home/$USERNAME"
 export SYNCTHING="$HOME/bin/syncthing"
 
-chpst -u "$USERNAME" "$SYNCTHING" -logflags 0 2>&1 | logger -t syncthing
+exec 2>&1
+exec chpst -u "$USERNAME" "$SYNCTHING" -logflags 0