diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-01-19 09:37:18 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-01-19 09:48:15 +0000 |
commit | 722046e8a8f9861802c82e0494ab019f16d06291 (patch) | |
tree | 33808381240b6c5a1b7278a231883b9ed23c307f /main/lighttpd/lighttpd.initd | |
parent | 4b33a80ba058c8f3513aa3882d262502a722e24e (diff) | |
download | aports-722046e8a8f9861802c82e0494ab019f16d06291.tar.bz2 aports-722046e8a8f9861802c82e0494ab019f16d06291.tar.xz |
main/lighttpd: fix init.d script
ref #943
Diffstat (limited to 'main/lighttpd/lighttpd.initd')
-rw-r--r-- | main/lighttpd/lighttpd.initd | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/main/lighttpd/lighttpd.initd b/main/lighttpd/lighttpd.initd index a0bcc0110e..90aa82f1b8 100644 --- a/main/lighttpd/lighttpd.initd +++ b/main/lighttpd/lighttpd.initd @@ -1,19 +1,16 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd-1.4.13-r3,v 1.2 2007/10/12 20:54:46 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd,v 1.21 2012/01/08 20:45:46 hwoarang Exp $ -opts="reload graceful" +extra_started_commands="reload graceful" depend() { need net - use mysql logger spawn-fcgi ldap slapd - after famd firewall sshd -} - -_confopt() { - /usr/sbin/lighttpd -p -f ${LIGHTTPD_CONF} | awk -F = \ - "/$1/"' {sub(/^ *"/, "", $2); sub(/" */, "", $2); print $2}' + use mysql logger spawn-fcgi ldap slapd netmount dns + after firewall + after famd + after sshd } checkconfig() { @@ -22,14 +19,17 @@ checkconfig() { return 1 fi + if [ -z "${LIGHTTPD_PID}" ] ; then + ewarn "server.pid-file variable in ${LIGHTTPD_CONF}" + ewarn "is not set. Falling back to lighttpd.pid" + LIGHTTPD_PID="/var/run/lighttpd.pid" + fi /usr/sbin/lighttpd -t -f ${LIGHTTPD_CONF} >/dev/null } start() { checkconfig || return 1 - local _user=$(_confopt server.user) - local _group=$(_confopt server.group) - chown $_user:$_group /var/*/lighttpd + checkpath -d -q -m 0750 -o lighttpd:lighttpd /var/run/lighttpd/ ebegin "Starting lighttpd" start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \ @@ -52,7 +52,7 @@ reload() { checkconfig || return 1 ebegin "Re-opening lighttpd log files" - start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \ + start-stop-daemon --quiet --pidfile "${LIGHTTPD_PID}" \ --signal HUP eend $? } @@ -65,7 +65,7 @@ graceful() { checkconfig || return 1 ebegin "Gracefully stopping lighttpd" - start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \ + start-stop-daemon --quiet --pidfile "${LIGHTTPD_PID}" \ --signal INT if eend $? ; then rm -f "${LIGHTTPD_PID}" |