Gentoo Archives: gentoo-commits

From: "Thilo Bangert (bangert)" <bangert@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/lighttpd/files: lighttpd.initd
Date: Fri, 03 Apr 2009 21:23:36
Message-Id: E1LpqUB-0005Ex-0U@stork.gentoo.org
1 bangert 09/04/03 20:59:35
2
3 Modified: lighttpd.initd
4 Log:
5 prepare for 1.4.22 - copy mod_fastcgi.conf-1.4.13-r2 to mod_fastcgi.conf and lighttpd.initd-1.4.13-r2 to lighttpd.initd
6 (Portage version: 2.2_rc26/cvs/Linux i686)
7
8 Revision Changes Path
9 1.13 www-servers/lighttpd/files/lighttpd.initd
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd?rev=1.13&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd?rev=1.13&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd?r1=1.12&r2=1.13
14
15 Index: lighttpd.initd
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd,v
18 retrieving revision 1.12
19 retrieving revision 1.13
20 diff -u -r1.12 -r1.13
21 --- lighttpd.initd 12 Oct 2007 20:54:46 -0000 1.12
22 +++ lighttpd.initd 3 Apr 2009 20:59:34 -0000 1.13
23 @@ -1,19 +1,19 @@
24 #!/sbin/runscript
25 -# Copyright 1999-2005 Gentoo Foundation
26 +# Copyright 1999-2009 Gentoo Foundation
27 # Distributed under the terms of the GNU General Public License v2
28 -# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd,v 1.12 2007/10/12 20:54:46 swegener Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd,v 1.13 2009/04/03 20:59:34 bangert Exp $
30
31 -opts="depend checkconfig start stop reload"
32 +opts="reload graceful"
33
34 depend() {
35 need net
36 - use mysql logger spawn-fcgi ldap slapd
37 + use mysql logger spawn-fcgi ldap slapd netmount dns
38 after famd
39 after sshd
40 }
41
42 checkconfig() {
43 - if [[ ! -f ${LIGHTTPD_CONF} ]] ; then
44 + if [ ! -f "${LIGHTTPD_CONF}" ] ; then
45 ewarn "${LIGHTTPD_CONF} does not exist."
46 return 1
47 fi
48 @@ -25,31 +25,43 @@
49 checkconfig || return 1
50
51 ebegin "Starting lighttpd"
52 - start-stop-daemon --start --quiet \
53 - --background --pidfile ${LIGHTTPD_PID} \
54 - --exec /usr/sbin/lighttpd -- -f ${LIGHTTPD_CONF}
55 + start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \
56 + --pidfile "${LIGHTTPD_PID}" -- -f "${LIGHTTPD_CONF}"
57 eend $?
58 }
59
60 stop() {
61 local rv=0
62 ebegin "Stopping lighttpd"
63 - if start-stop-daemon --stop --quiet --pidfile ${LIGHTTPD_PID} \
64 - --signal 2 ; then
65 - rm -f ${LIGHTTPD_PID}
66 - else
67 - rv=1
68 - fi
69 - eend $rv
70 + start-stop-daemon --stop --quiet --pidfile "${LIGHTTPD_PID}"
71 + eend $?
72 }
73
74 reload() {
75 - if [ ! -f ${LIGHTTPD_PID} ]; then
76 - eerror "lighttpd isn't running"
77 + if ! service_started "${SVCNAME}" ; then
78 + eerror "${SVCNAME} isn't running"
79 return 1
80 fi
81 checkconfig || return 1
82 +
83 ebegin "Re-opening lighttpd log files"
84 - kill -HUP `cat ${LIGHTTPD_PID}` &>/dev/null
85 + start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \
86 + --signal HUP
87 eend $?
88 }
89 +
90 +graceful() {
91 + if ! service_started "${SVCNAME}" ; then
92 + eerror "${SVCNAME} isn't running"
93 + return 1
94 + fi
95 + checkconfig || return 1
96 +
97 + ebegin "Gracefully stopping lighttpd"
98 + start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \
99 + --signal INT
100 + if eend $? ; then
101 + rm -f "${LIGHTTPD_PID}"
102 + start
103 + fi
104 +}