Package: mini-httpd
Version: 1.23-1.2
Severity: important

Dear Maintainer,

1. I started mini-httpd with "systemctl start mini-httpd"


2. I tried to stop it with "systemctl stop mini-httpd"

3. The process was still running. Among other log messages ther was this
   one 

    start-stop-daemon: warning: this system is not able to track process names 
longer than 15 characters, please use --exec instead of --name.

4. I expected mini-httpd to stop after "systemctl stop" command.

To fix the problem, the following patch for /etc/init.d/mini-httpd is
required.

--8<---------------cut here---------------start------------->8---
--- a/etc/init.d/mini-httpd     2018-07-01 17:10:15.354864914 +0200
+++ b/etc/init.d/mini-httpd     2018-07-01 17:10:31.079301238 +0200
@@ -60,7 +60,7 @@
                        fi
                fi
        else 
-               start-stop-daemon --stop --quiet --oknodo --name $DAEMON
+               start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
        fi
        echo "$NAME."
 }
--8<---------------cut here---------------end--------------->8---


-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-6-amd64 (SMP w/4 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8), 
LANGUAGE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mini-httpd depends on:
ii  libc6      2.24-11+deb9u3
ii  libssl1.1  1.1.0f-3+deb9u2

Versions of packages mini-httpd recommends:
pn  apache2-utils  <none>

mini-httpd suggests no packages.

-- Configuration Files:
/etc/default/mini-httpd changed:
START=1
DAEMON_OPTS="-C /etc/mini-httpd.conf"

/etc/init.d/mini-httpd changed:
set -x
. /lib/lsb/init-functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/mini_httpd
NAME=mini_httpd
DESC="web server"
PIDFILE=/var/run/mini_httpd.pid
test -x $DAEMON || exit 0
if [ -f /etc/default/mini-httpd ]
then
        . /etc/default/mini-httpd
fi
set -e
start() {
        if [ "$START" = "1" ]
        then
                echo -n "Starting $DESC: "
                start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
                        --exec $DAEMON -- $DAEMON_OPTS
                echo "$NAME."
        else
                printf "You have to edit /etc/mini-httpd.conf 
and\n/etc/default/mini-httpd before running mini-httpd!\n"
                printf " "
                exit 0
        fi
}
stop() {
        echo -n "Stopping $DESC: "
        # Get pid number
        if [ -e /var/run/$NAME.pid ]
        then
                PID=`cat /var/run/$NAME.pid`
                if [ -d /proc/$PID ]
                then
                        start-stop-daemon -v --stop --quiet --oknodo --pidfile 
/var/run/$NAME.pid
                else
                        # we need to remove the pidfile manually
                        if [ -e /var/run/$NAME.pid ]
                        then
                                rm -f /var/run/$NAME.pid
                        fi
                fi
        else 
                start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
        fi
        echo "$NAME."
}
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
        ;;
  restart|force-reload)
        stop
        start
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
        exit 1
        ;;
esac
exit 0

/etc/mini-httpd.conf changed:
ssl
host=zniczek.stlmch.eu
port=80
user=nobody
nochroot # no
data_dir=/var/www/html
cgipat=cgi-bin/*
certfile=/etc/ssl/private/mini-httpd.cert
logfile=/var/log/mini-httpd.log
pidfile=/var/run/mini-httpd.pid
charset=iso-8859-1


-- no debconf information

-- 
Było mi bardzo miło.                                  --- Rurku. --- ...
>Łukasz<                                --- To dobrze, że mnie słuchasz.

Attachment: signature.asc
Description: PGP signature

Reply via email to