aports/testing/3proxy/3proxy.initd
Johannes Heimansberg 2c8eb6cce7 testing/3proxy: fix init script and use supervise-daemon instead of start-stop-daemon
There are a couple of issues with the start-stop-daemon call in the init script, that
prevent it from working with 3proxy 0.8.13:
- 3proxy does not understand the --pidfile and --user options that are passed to it
  by start-stop-daemon (are they meant for start-stop-daemon instead?)
- Since 3proxy does not write its own pidfile by default, start-stop-daemon would
  need the -m option, so it would create the .pid file; instead of doing that
  supervise-daemon is now used instead, which avoids PID files altogether
- Both start-stop-daemon and supervise-daemon get confused when passing a user name
  starting with a number via the --user option and interpret it as a numeric UID; to
  avoid this, the UID/GID of the "3proxy" user/group are now fetched with
  ``id -u``/``id -g`` and then the correct numeric UID and GID are passed
2020-09-24 22:53:22 +00:00

12 lines
235 B
Bash

#!/sbin/openrc-run
supervisor="supervise-daemon"
command="/usr/bin/3proxy"
CONFFILE=/etc/$SVCNAME/$SVCNAME.cfg
command_args="$CONFFILE"
command_user="$(id -u 3proxy):$(id -g 3proxy)"
required_files="$CONFFILE"
depend() {
need net
}