aboutsummaryrefslogtreecommitdiffstats
path: root/www/thttpd
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>2000-07-14 07:47:54 +0800
committersteve <steve@FreeBSD.org>2000-07-14 07:47:54 +0800
commitf6b2f811eca2ba650e6fe9904b94ca0cd789547e (patch)
tree23a6b49372cf14fa099b8c376a73cbe266a08038 /www/thttpd
parent2c8f976c7180816c81eed3958bd631666c598805 (diff)
downloadfreebsd-ports-gnome-f6b2f811eca2ba650e6fe9904b94ca0cd789547e.tar.gz
freebsd-ports-gnome-f6b2f811eca2ba650e6fe9904b94ca0cd789547e.tar.zst
freebsd-ports-gnome-f6b2f811eca2ba650e6fe9904b94ca0cd789547e.zip
- On startup, /etc/rc procedure stops when thttpd is installed.
* ${PREFIX}/etc/rc.d/thttpd.sh does not return. * FIX: invoke thttpd_wrapper as a background process. - On shutdown, Message "No processes matching ``thttpd_wrapper''" is shown. * thttpd_wrapper is actually a shell script, not an executable. * FIX: Record the pid of thttpd_wrapper to /var/run. * FIX: Use pid-file when killing the wrapper. Submitted by: Makoto MATSUSHITA <matusita@jp.freebsd.org> Reviewed by: Anders Nordby <anders@fix.no> (maintainer)
Diffstat (limited to 'www/thttpd')
-rw-r--r--www/thttpd/Makefile1
-rw-r--r--www/thttpd/files/thttpd.sh4
2 files changed, 3 insertions, 2 deletions
diff --git a/www/thttpd/Makefile b/www/thttpd/Makefile
index dbce4834afcc..691f94183195 100644
--- a/www/thttpd/Makefile
+++ b/www/thttpd/Makefile
@@ -41,6 +41,7 @@ do-install:
@if [ ! -f ${PREFIX}/sbin/thttpd_wrapper ]; then \
${ECHO} "Installing ${PREFIX}/sbin/thttpd_wrapper file."; \
${ECHO} "#!/bin/sh" > ${PREFIX}/sbin/thttpd_wrapper; \
+ ${ECHO} "${ECHO} \$$\$$ > /var/run/thttpd_wrapper.pid" >> ${PREFIX}/sbin/thttpd_wrapper; \
${ECHO} "while true ; do" >> ${PREFIX}/sbin/thttpd_wrapper; \
${ECHO} " ${PREFIX}/sbin/thttpd -D -C ${PREFIX}/etc/thttpd.conf" >> ${PREFIX}/sbin/thttpd_wrapper; \
${ECHO} " sleep 10" >> ${PREFIX}/sbin/thttpd_wrapper; \
diff --git a/www/thttpd/files/thttpd.sh b/www/thttpd/files/thttpd.sh
index 34a848a96082..6129c1145d58 100644
--- a/www/thttpd/files/thttpd.sh
+++ b/www/thttpd/files/thttpd.sh
@@ -7,10 +7,10 @@ fi
case "$1" in
start)
- [ -x ${PREFIX}/sbin/thttpd_wrapper ] && ${PREFIX}/sbin/thttpd_wrapper && echo -n ' thttpd'
+ [ -x ${PREFIX}/sbin/thttpd_wrapper ] && ${PREFIX}/sbin/thttpd_wrapper & && echo -n ' thttpd'
;;
stop)
- killall thttpd_wrapper && killall thttpd && echo -n ' thttpd'
+ kill `cat /var/run/thttpd_wrapper.pid` && killall thttpd && echo -n ' thttpd'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2