[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#673918: thttpd: New /etc/init.d script has bad logic and exits before starting daemon.



Package: thttpd
Version: 2.25b-11
Severity: important


The logic in the BASH script that starts the daemon is faulty and
causes the script to exit before starting the daemon. I solved this by
commneting out all lines between the setting of variables and the "set
-e" line before the case statment. I don't think most users are able
to do a hack like this. I don't really know BASH flow control, but I
got it going. I use thttpd as my production server. Thank you.

-- System Information:
Debian Release: 6.0.5
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-238.19.1.el5.028stab092.2 (SMP w/16 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages thttpd depends on:
ii  libc6                         2.11.3-3   Embedded GNU C Library: Shared lib

Versions of packages thttpd recommends:
ii  logrotate                     3.7.8-6    Log rotation utility

Versions of packages thttpd suggests:
pn  thttpd-util                   <none>     (no description available)

-- Configuration Files:
/etc/init.d/thttpd changed:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/thttpd
DESC="web server"
NAME=thttpd
DEFAULTS=/etc/default/thttpd
CONFFILE=/etc/thttpd/thttpd.conf
PIDFILE=/var/run/thttpd.pid
OPTIONS="-C $CONFFILE -i $PIDFILE"
set -e
case "$1" in
	start)
		echo -n "Starting $DESC: "
		start-stop-daemon -S -q -p $PIDFILE -x $DAEMON --oknodo -- $OPTIONS
		echo "$NAME."
		;;
	stop)
		echo -n "Stopping $DESC: "
		start-stop-daemon -K -q -p $PIDFILE -x $DAEMON --oknodo --signal 10
		echo "$NAME."
		;;
	force-stop)
		echo -n "Stopping $DESC: "
		start-stop-daemon -K -q -p $PIDFILE -x $DAEMON
		echo "$NAME."
		;;
	force-reload)
		if start-stop-daemon -K -q -p $PIDFILE -x $DAEMON --test
		then
			$0 restart
		fi
		;;
	restart)
		$0 stop
		sleep 1
		$0 start
		;;
	*)
		N=/etc/init.d/$NAME
		echo "Usage: $N {start|stop|force-stop|restart|force-reload}" >&2
		exit 1
		;;
esac
exit 0

/etc/logrotate.d/thttpd [Errno 2] No such file or directory: u'/etc/logrotate.d/thttpd'
/etc/thttpd/thttpd.conf changed:
port=80
dir=/var/www
chroot
vhost
user=www-data
cgipat=www.info-underground.net/users/*/*.cgi|*/cgi-bin/*|www.talkgeektome.us/*.cgi
throttles=/etc/thttpd/throttle.conf
logfile=/dev/null
charset=utf-8
max_age=17940


-- no debconf information



Reply to: