aboutsummaryrefslogtreecommitdiffstats
path: root/main/fcgiwrap
diff options
context:
space:
mode:
Diffstat (limited to 'main/fcgiwrap')
-rw-r--r--main/fcgiwrap/APKBUILD16
-rw-r--r--main/fcgiwrap/fcgiwrap.confd6
-rw-r--r--main/fcgiwrap/fcgiwrap.initd22
3 files changed, 34 insertions, 10 deletions
diff --git a/main/fcgiwrap/APKBUILD b/main/fcgiwrap/APKBUILD
index f89b98b83c..e021fc6556 100644
--- a/main/fcgiwrap/APKBUILD
+++ b/main/fcgiwrap/APKBUILD
@@ -1,7 +1,7 @@
-# Maintainer:
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fcgiwrap
pkgver=1.1.0
-pkgrel=2
+pkgrel=3
pkgdesc="Simple server for running CGI applications over FastCGI"
url="https://github.com/gnosek/fcgiwrap"
arch="all"
@@ -10,9 +10,10 @@ pkgusers="fcgiwrap"
pkggroups="www-data"
install="$pkgname.pre-install"
makedepends="$depends_dev autoconf libtool automake fcgi-dev"
-subpackages="$pkgname-doc"
+subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/gnosek/$pkgname/archive/$pkgver.tar.gz
- $pkgname.initd"
+ $pkgname.initd
+ $pkgname.confd"
builddir="$srcdir/$pkgname-$pkgver"
@@ -28,11 +29,12 @@ build() {
package() {
cd "$builddir"
- mkdir -p "$pkgdir"/var/run/fcgiwrap
+ install -d -m2775 -o fcgiwrap -g www-data "$pkgdir"/run/fcgiwrap
make DESTDIR="$pkgdir" install
install -Dm755 $srcdir/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
- chown $pkgusers.$pkggroups "$pkgdir"/var/run/fcgiwrap
+ install -Dm644 $srcdir/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}
sha512sums="b8d35762d1d3c94a67602290b0092f0c38cffbbcd3dbc16597abf8b92172909b04450c238de2e430e841a17dd47fdd48d6a001f77539966980ef1af61e447ddc fcgiwrap-1.1.0.tar.gz
-b12afb8e54e7fb9f01bab74895bcffb49993fac1fc1091576c096d5a325abfd6579eb3dd9ec82aabc6dddb26dac584d216b5d0823cd802fd1d9078e82d883b12 fcgiwrap.initd"
+0dbf5f4387e5dc5de6e9bd6d98247e175f1a7943fe1d04ea916881b1269fd0b62abfafac91f8c0dd2f4dc9c71118195ba9dd7cf9bb5e3d93e6e711ec7d770453 fcgiwrap.initd
+893e9afa92c20c9d0dab68fffc806a1be1f2e28a7e73bbb497316386a9ee083be4bad68a90f660e489311a9812a512b50fb0edb8b9c49b12f6cd266ba53b01a6 fcgiwrap.confd"
diff --git a/main/fcgiwrap/fcgiwrap.confd b/main/fcgiwrap/fcgiwrap.confd
new file mode 100644
index 0000000000..72dbdbc376
--- /dev/null
+++ b/main/fcgiwrap/fcgiwrap.confd
@@ -0,0 +1,6 @@
+# set number of preforked children. defaults to number of system CPUs
+#nproc=$(nproc)
+
+# set listen socket. Defaults to unix:/run/fcgiwrap/fcgiwrap.sock
+#socket=unix:/run/fcgiwrap/fcgiwrap.sock
+
diff --git a/main/fcgiwrap/fcgiwrap.initd b/main/fcgiwrap/fcgiwrap.initd
index f5faa7dfd9..353e51f393 100644
--- a/main/fcgiwrap/fcgiwrap.initd
+++ b/main/fcgiwrap/fcgiwrap.initd
@@ -4,24 +4,40 @@ name="fcgiwrap"
description="fcgiwrap cgi daemon"
command="/usr/bin/fcgiwrap"
-command_args="-c 3 -s unix:/var/run/fcgiwrap/fcgiwrap.sock"
command_background="yes"
-pidfile="/var/run/fcgiwrap/fcgiwrap.pid"
user="fcgiwrap"
group="www-data"
+: ${socket:=unix:/run/fcgiwrap/fcgiwrap.sock}
depend() {
need net localmount
after firewall
}
+start_pre() {
+ command_args="-c ${nproc:-$(nproc)} -s $socket"
+ case "$socket" in
+ unix:/*)
+ local socket_path=${socket#unix:}
+ checkpath --directory --mode 2775 --owner ${user}:${group} \
+ ${socket_path%/*}
+ ;;
+ esac
+}
+
start() {
ebegin "Starting ${name}"
start-stop-daemon --exec ${command} \
- --pidfile ${pidfile} --make-pidfile \
--background \
-u ${user} -g ${group} \
--start -- ${command_args}
eend $?
}
+stop_post() {
+ case "$socket" in
+ unix:/*)
+ rm -f "${socket#unix:}"
+ ;;
+ esac
+}