Skip to content
Snippets Groups Projects
Commit 2c8eb6cc authored by Johannes Heimansberg's avatar Johannes Heimansberg :frog: Committed by Leo
Browse files

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
parent d93c91f4
No related branches found
No related tags found
1 merge request!11951testing/3proxy: fix wrong invocation of start-stop-daemon and 3proxy in init script
#!/sbin/openrc-run #!/sbin/openrc-run
# supervisor="supervise-daemon"
# Start 3proxy tiny proxy server. command="/usr/bin/3proxy"
# CONFFILE=/etc/$SVCNAME/$SVCNAME.cfg
command_args="$CONFFILE"
CONFFILE=/etc/${SVCNAME}/${SVCNAME}.cfg command_user="$(id -u 3proxy):$(id -g 3proxy)"
PIDFILE=/var/run/${SVCNAME}.pid required_files="$CONFFILE"
depend() { depend() {
need net need net
} }
start() {
if [ ! -f "${CONFFILE}" ]; then
eerror "Configuration file ${CONFFILE} not found!"
return 1
fi
ebegin "Starting 3proxy"
start-stop-daemon --start --quiet --exec /usr/bin/3proxy --pidfile "${PIDFILE}" \
-- --pidfile "${PIDFILE}" --user 3proxy.3proxy "${CONFFILE}" #2>/dev/null
eend $?
}
stop() {
ebegin "Stopping 3proxy"
start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
eend $?
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Maintainer: # Maintainer:
pkgname=3proxy pkgname=3proxy
pkgver=0.8.13 pkgver=0.8.13
pkgrel=0 pkgrel=1
pkgdesc="Really tiny cross-platform proxy servers set" pkgdesc="Really tiny cross-platform proxy servers set"
url="https://3proxy.ru" url="https://3proxy.ru"
arch="all" arch="all"
...@@ -31,4 +31,4 @@ package() { ...@@ -31,4 +31,4 @@ package() {
} }
sha512sums="94b4a2568917c1d720276e38050a13e144d3e92ff41edd02eeebac0a6c21e6a839a58ea7dcb3abc03370e0f18452c953cfd7ad15ebac87e66b78d94fa52fbd79 3proxy-0.8.13.tar.gz sha512sums="94b4a2568917c1d720276e38050a13e144d3e92ff41edd02eeebac0a6c21e6a839a58ea7dcb3abc03370e0f18452c953cfd7ad15ebac87e66b78d94fa52fbd79 3proxy-0.8.13.tar.gz
b3ae325013d37a021439bcacb42f5fa51440873b68ea8c42ef30d87df73d47c4426f7f96acf05c6e877f967c66d7ee65663889f8163dd5cf1ffec89344cb49c4 3proxy.initd" 043fa5784623e29961ae92f5370598d420e55da6d04f6421b585ac050694982765d6b57ee0276a10738bc8ad0e49ddc4edf6ef288bb9c68e7da11b572066688e 3proxy.initd"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment