diff options
author | jlam <jlam@pkgsrc.org> | 2001-01-14 06:14:13 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2001-01-14 06:14:13 +0000 |
commit | dea113dec7078088e87ef18b49b767f118c50851 (patch) | |
tree | b282a0451ba52cc2d62bec66afc1cb2ba1794735 /www/thttpd/files | |
parent | f7c81d455f06d1b2d5bf06abeacc463860fa607f (diff) | |
download | pkgsrc-dea113dec7078088e87ef18b49b767f118c50851.tar.gz |
Install cgi-bin programs with executable bit set, and modify thttpd rc.d
script to check for the pid instead of requiring a pidfile that may not
exist.
Diffstat (limited to 'www/thttpd/files')
-rw-r--r-- | www/thttpd/files/patch-sum | 4 | ||||
-rw-r--r-- | www/thttpd/files/thttpd.sh | 25 |
2 files changed, 19 insertions, 10 deletions
diff --git a/www/thttpd/files/patch-sum b/www/thttpd/files/patch-sum index df66e7f57cc..8430e35dd01 100644 --- a/www/thttpd/files/patch-sum +++ b/www/thttpd/files/patch-sum @@ -1,6 +1,6 @@ -$NetBSD: patch-sum,v 1.9 2000/12/17 22:21:44 jlam Exp $ +$NetBSD: patch-sum,v 1.10 2001/01/14 06:14:13 jlam Exp $ MD5 (patch-aa) = 0849eeaf8e38c6a920cc6f7cdd4f0132 MD5 (patch-ab) = 947db3fea2e41d03e5fe2324d5a75727 -MD5 (patch-ac) = 3af8b6c6b56c05bae0d3d1b18df6c7ce +MD5 (patch-ac) = c8d5612d1f37a5497a3b9b5d67fdcf95 MD5 (patch-ad) = 6125ef20626049c8ba0560243d4a2695 diff --git a/www/thttpd/files/thttpd.sh b/www/thttpd/files/thttpd.sh index d941b96cdb6..5b8ef544608 100644 --- a/www/thttpd/files/thttpd.sh +++ b/www/thttpd/files/thttpd.sh @@ -1,45 +1,54 @@ #!/bin/sh # -# $NetBSD: thttpd.sh,v 1.3 2000/09/20 05:14:13 jlam Exp $ +# $NetBSD: thttpd.sh,v 1.4 2001/01/14 06:14:13 jlam Exp $ # # PROVIDE: thttpd # REQUIRE: DAEMON name="thttpd" command=@PREFIX@/sbin/${name} -pidfile="/var/run/${name}.pid" + +pid=`ps -ax | awk '{print $1,$5}' | grep ${name} | awk '{print $1}'` cmd=${1:-start} case ${cmd} in start) - if [ -x ${command} -a -f /etc/${name}.conf ] + if [ "$pid" = "" -a -x ${command} -a -f /etc/${name}.conf ] then echo "Starting ${name}." - ${command} -i ${pidfile} -C /etc/${name}.conf + ${command} -C /etc/${name}.conf fi ;; + stop) - if [ -f ${pidfile} ]; then - pid=`head -1 ${pidfile}` + if [ "$pid" != "" ] + then echo "Stopping ${name}." kill -TERM ${pid} else echo "${name} not running?" fi ;; + restart) ( $0 stop ) sleep 1 $0 start ;; + status) - if [ -f ${pidfile} ]; then - pid=`head -1 ${pidfile}` + if [ "$pid" != "" ] + then echo "${name} is running as pid ${pid}." else echo "${name} is not running." fi ;; + +*) + echo 1>&2 "Usage: ${name} [restart|start|stop|status]" + exit 1 + ;; esac exit 0 |