aboutsummaryrefslogtreecommitdiffstats
path: root/www-misc/slowcgi
diff options
context:
space:
mode:
Diffstat (limited to 'www-misc/slowcgi')
-rw-r--r--www-misc/slowcgi/Manifest5
-rw-r--r--www-misc/slowcgi/files/6.7-Add-flag-to-run-in-the-foreground.patch70
-rw-r--r--www-misc/slowcgi/files/slowcgi.initd2
-rw-r--r--www-misc/slowcgi/slowcgi-6.7-r3.ebuild (renamed from www-misc/slowcgi/slowcgi-6.7-r2.ebuild)4
4 files changed, 78 insertions, 3 deletions
diff --git a/www-misc/slowcgi/Manifest b/www-misc/slowcgi/Manifest
index d1a250e..38ef3a4 100644
--- a/www-misc/slowcgi/Manifest
+++ b/www-misc/slowcgi/Manifest
@@ -1,5 +1,6 @@
+AUX 6.7-Add-flag-to-run-in-the-foreground.patch 2062 BLAKE2B 855bfaa65d5afdd9ca3fd1b3484d4948b4c986462e568e6b816ad1e1278c289cefaed37cd7ff79de21090949df4a09b1a7df6832e85bc34fe196fa4c3dc9bdaf SHA512 b4aa034020558875cbe33dff74fc3e4832adddda3a3409c4878eaed831dcf4a5f44a4b0930f014e17d37705e3727df48b6beb0d3e1b63956ba4be58bfd368989
AUX slowcgi.confd 141 BLAKE2B 7b2880ddcbd1cb4e9976925d8f01085e26323edc4c33d292ed472eee2268134672967246e7fc520aec252e0be439fc6b4b462af1a83dbd7009cfea1d62f8958e SHA512 4b255b338a873f830ac569c04e19a35d2e069abb9bd593657f97651f582158139a2d9fb187446c97dede0d436699fdefa6648034403a240bcebb0a6ea9a9b2c6
-AUX slowcgi.initd 297 BLAKE2B 8df735426642b5ffe7dc818fd0d06c01f40b995264f1b7dc0870c3641088937b7dcda08849e6c0cd4fa9fd6d07558a40d9b0753dd66a5dbcd6b9880e0ccfcc81 SHA512 28dbb42caa486e06560b5756f7572a85f553612f72ed68f450915f54bc7446de9891efcb03bafb59ad1be20df5e7c5d14dc27530d5e9f4551f7badd545eca19d
+AUX slowcgi.initd 297 BLAKE2B 9c1fb1867104beed84725c658a76b606b4ff3a78dc4b8e6722ddff40eee8eefd40522d17c1fefc8869750bc0ebed50a513b62866da9c19ab6e527d378dee2bea SHA512 a24a584c4cbedfa604a22d74851f9d74988037422c765e58174950143d2b481c17527400e178879dd342fb4bc4ce4c26b67095b2c26b5b19672f9a5647e9047a
DIST slowcgi-6.7.tar.gz 14310 BLAKE2B d01b8fdc5d24483042cd229a77761ec8d5df6ef723857587dfabe174f8f8080317a2985932252781ec32212302f04735c6e0736a307429e7ff44870cb4f9d1d0 SHA512 b73036302bd7d51bcd44243f0923302634f8af7d3f6771b22e3e104dea2d208fa70505c0d3b2d95b0617fbdcf71e068908c5a59a2b172c5c26b323940cc63e2e
-EBUILD slowcgi-6.7-r2.ebuild 539 BLAKE2B 8023e3267bfb2ec8d6a0972e7d79f065afee6d90e27c42f1cbbbc500ff2d8297a5f010f8071b2e7bd3ae7e067cbad94e7050984b1b23c87b33851b4fd9d8f3b5 SHA512 ae4f5d0edd78ea06066235517322d4d6cb7e27728399ec52f4aed7db2251b77b6c62fded6f98ff100b9bcec8f56b37e8898df8e8809f8c703cf56b8726b82c71
+EBUILD slowcgi-6.7-r3.ebuild 613 BLAKE2B 1d710a5ce4d07656f33f1446e712cd5554481d4e9c5c8b4435760167ec4d9a4291088798105b7760fd0648309f136e803575b9a60024d96c31ff51b46de5aa4b SHA512 d5078914b1b017d255ea96d0d7baa7c0bd7001f8bd2a6415a4bb3052ce7a6106cc70b4683b1efd98bb6c2627b1b2619c3c2af75740a768b3e0b80e40a4cfae61
MISC metadata.xml 223 BLAKE2B 2c1cd83f1f1d25a43ea978cd66b5c9f6020889613dfaed65d6745858a45d4bf50fda775305420e41c36cafd63d63746ed894411acbced66ab8ae04906dfb8592 SHA512 4f71eacfeb2b21a4ea746ce1663777937b920e942c94eef1fe93c3557e207c9fdb2569369d56637cba563dc50179d62195db6225123ecfedc303600b8a0bb49b
diff --git a/www-misc/slowcgi/files/6.7-Add-flag-to-run-in-the-foreground.patch b/www-misc/slowcgi/files/6.7-Add-flag-to-run-in-the-foreground.patch
new file mode 100644
index 0000000..ecf6fff
--- /dev/null
+++ b/www-misc/slowcgi/files/6.7-Add-flag-to-run-in-the-foreground.patch
@@ -0,0 +1,70 @@
+From 6771bdc5dc8a42da2787aca1f83c1b93725f204e Mon Sep 17 00:00:00 2001
+From: Wynn Wolf Arbor <wolf@oriole.systems>
+Date: Fri, 5 Jun 2020 21:14:44 +0200
+Subject: [PATCH] Add flag to run in the foreground
+
+slowcgi already has the -d flag to disable forking, but that particular
+flag also enables debug output and stops slowcgi from logging to syslog.
+
+Ordinarily this would be fine, but sadly we know of no clean way to
+track the PID of a forked process with Gentoo's OpenRC and its
+start-stop-daemon(8). We could add support to write a pidfile instead,
+but since we want to support multiple invocations of slowcgi through
+OpenRC and ${RC_SVCNAME}, we need a way of specifying the pidfile
+location in the init script itself.
+
+To solve this reasonably cleanly, add a flag that *only* controls
+whether or not the program daemonizes or not.
+---
+ slowcgi.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/slowcgi.c b/slowcgi.c
+index 87ae5b2..0a34c80 100644
+--- a/slowcgi.c
++++ b/slowcgi.c
+@@ -274,7 +274,7 @@ usage(void)
+ {
+ extern char *__progname;
+ fprintf(stderr,
+- "usage: %s [-d] [-p path] [-s socket] [-U user] [-u user]\n",
++ "usage: %s [-df] [-p path] [-s socket] [-U user] [-u user]\n",
+ __progname);
+ exit(1);
+ }
+@@ -282,6 +282,7 @@ usage(void)
+ struct timeval timeout = { TIMEOUT_DEFAULT, 0 };
+ struct slowcgi_proc slowcgi_proc;
+ int debug = 0;
++int foreground = 0;
+ int on = 1;
+ char *fcgi_socket = "/var/www/run/slowcgi.sock";
+
+@@ -314,11 +315,14 @@ main(int argc, char *argv[])
+ }
+ }
+
+- while ((c = getopt(argc, argv, "dp:s:U:u:")) != -1) {
++ while ((c = getopt(argc, argv, "dfp:s:U:u:")) != -1) {
+ switch (c) {
+ case 'd':
+ debug = 1;
+ break;
++ case 'f':
++ foreground = 1;
++ break;
+ case 'p':
+ chrootpath = optarg;
+ break;
+@@ -340,7 +344,7 @@ main(int argc, char *argv[])
+ if (geteuid() != 0)
+ errx(1, "need root privileges");
+
+- if (!debug && daemon(0, 0) == -1)
++ if (!debug && !foreground && daemon(0, 0) == -1)
+ err(1, "daemon");
+
+ if (!debug) {
+--
+2.27.0
+
diff --git a/www-misc/slowcgi/files/slowcgi.initd b/www-misc/slowcgi/files/slowcgi.initd
index 1aff8fb..b21dd71 100644
--- a/www-misc/slowcgi/files/slowcgi.initd
+++ b/www-misc/slowcgi/files/slowcgi.initd
@@ -3,6 +3,6 @@
# Distributed under the terms of the GNU General Public License v2
command="slowcgi"
-command_args="-d -p \"${SLOWCGI_CHROOT:-/}\" -s \"/run/${RC_SVCNAME}.sock\" -U slowcgi -u slowcgi"
+command_args="-f -p \"${SLOWCGI_CHROOT:-/}\" -s \"/run/${RC_SVCNAME}.sock\" -U slowcgi -u slowcgi"
command_background=yes
pidfile="/run/${RC_SVCNAME}.pid"
diff --git a/www-misc/slowcgi/slowcgi-6.7-r2.ebuild b/www-misc/slowcgi/slowcgi-6.7-r3.ebuild
index b6448c9..8df1b16 100644
--- a/www-misc/slowcgi/slowcgi-6.7-r2.ebuild
+++ b/www-misc/slowcgi/slowcgi-6.7-r3.ebuild
@@ -18,6 +18,10 @@ DEPEND="
acct-user/slowcgi
acct-group/http"
+PATCHES=(
+ "${FILESDIR}/${PV}-Add-flag-to-run-in-the-foreground.patch"
+)
+
src_install() {
emake PREFIX=/usr DESTDIR="${D}" install