projects/aports·commit 33479a90

Init.d script simplified, added reload() and removed prepare() from APKBUILD

33479a90 · Donoban <[email protected]> · 2021-04-18 17:59:27 +02:00

Commit
33479a90fa534e13aec217e345515ee467377f2d
Parents
df962358

Changes

2 files changed · +14 −26

FileStatusAddDelContent
main/tinyproxy/APKBUILDmodified+1−11View file
main/tinyproxy/tinyproxy.initdmodified+13−15View file

main/tinyproxy/APKBUILD

View file
diff --git a/main/tinyproxy/APKBUILD b/main/tinyproxy/APKBUILD
index a2748fe..1631bdc 100644
--- a/main/tinyproxy/APKBUILD
+++ b/main/tinyproxy/APKBUILD
@@ -17,16 +17,6 @@ source="https://github.com/tinyproxy/tinyproxy/releases/download/$pkgver/tinypro
pkgusers="tinyproxy"
pkggroups="tinyproxy"
-prepare() {
- default_prepare
- # set default user to tinyproxy:tinyproxy, correct pidfile and logfile
- sed -i -e 's:^User.*:User tinyproxy:' \
- -e 's:^Group.*:Group tinyproxy:' \
- -e 's:^\#PidFile.*:PidFile "/run/tinyproxy.pid":' \
- -e 's:^\#LogFile:LogFile:' \
- etc/tinyproxy.conf.in
-}
-
build() {
./configure \
--build=$CBUILD \
@@ -46,4 +36,4 @@ package() {
}
sha512sums="4917e8ebdb1c900387c686a6d490fc940993eb68419d46c7a666f2dfef7c4fa2268fba00b8c72db1a809d7118ec7dad1e4ba07c91cbc4119e37a76aad2856edf tinyproxy-1.11.0.tar.gz
-24f4bdde3945826ad4032a1275defd557c0903f99b225e0cfbd24f8d6fb0393ca2657ce8282983176b755c9e13f8525030209cabe5f74be21f922fd135921db7 tinyproxy.initd"
+e1b12989d1ee5eb6abe4749a687db4c2d0ddea1a3ec24a919d597a5cd673f509cce647ae7923993994dfb92b9f55fbf0ee0192c5f4e177da57599e917a2f4949 tinyproxy.initd"

main/tinyproxy/tinyproxy.initd

View file
diff --git a/main/tinyproxy/tinyproxy.initd b/main/tinyproxy/tinyproxy.initd
old mode 100644
new mode 100755
index 4fc6f03..dc8d3cc
--- a/main/tinyproxy/tinyproxy.initd
+++ b/main/tinyproxy/tinyproxy.initd
@@ -2,27 +2,25 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-get_config() {
- res=$(awk '$1 == "'$1'" { s=$2 } END { print s }' "$CONFFILE")
-
- if [ "x$res" = "x" ]; then
- echo "$2"
- else
- eval echo "$res"
- fi
-}
-
: ${CONFFILE:="/etc/${SVCNAME}/${SVCNAME}.conf"}
command=/usr/bin/tinyproxy
-command_args="-c ${CONFFILE}"
-pidfile=$(get_config PidFile /run/${SVCNAME}.pid)
+command_args="-d -c ${CONFFILE}"
+command_user="tinyproxy:tinyproxy"
+command_background="true"
+
+pidfile=/run/${SVCNAME}.pid
+output_log=/var/log/tinyproxy/${SVCNAME}.log
depend() {
config "$CONFFILE"
-
use dns
+}
+
+extra_started_commands="reload"
+reload() {
+ ebegin "Reloading ${SVCNAME}"
- [ "$(get_config Syslog Off)" = "On" ] && \
- use logger
+ start-stop-daemon --signal SIGUSR1 \
+ --exec "${command}" --pidfile "${pidfile}"
}