diff options
author | V.Krishn <vkrishn4@gmail.com> | 2013-05-08 13:21:21 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-05-09 06:45:33 +0000 |
commit | 7fb51995c49d292b40a4cf2429cafec98ec72f55 (patch) | |
tree | 7957e695f6c0b4f0dbf7e51144518702ac21e5ba /main/varnish/varnishd.initd | |
parent | 40f70f0e3529770eea2387974808398394548161 (diff) | |
download | aports-7fb51995c49d292b40a4cf2429cafec98ec72f55.tar.bz2 aports-7fb51995c49d292b40a4cf2429cafec98ec72f55.tar.xz |
Improved confd and add checkpath, build fixes
Diffstat (limited to 'main/varnish/varnishd.initd')
-rwxr-xr-x | main/varnish/varnishd.initd | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/main/varnish/varnishd.initd b/main/varnish/varnishd.initd index b8c565317c..54fb4a0a75 100755 --- a/main/varnish/varnishd.initd +++ b/main/varnish/varnishd.initd @@ -3,6 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/www-servers/varnish/files/varnishd.initd,v 1.7 2009/08/30 06:28:07 hollow Exp $ +VARNISH_CONF=${VARNISH_CONF:-${CFG_FILE}} extra_commands="reload flush" depend() { @@ -11,26 +12,34 @@ depend() { start() { ebegin "Starting varnish" + checkpath --directory --owner varnish:varnish \ + --mode 755 ${VARNISHD_PID_FILE%/*} #allow varnishd to lock logfile to memory ulimit -l 82000 - start-stop-daemon --quiet --start --pidfile /var/run/varnishd.pid --exec /usr/sbin/varnishd -- -P /var/run/varnishd.pid ${VARNISHD_OPTS} &> /dev/null + start-stop-daemon --quiet --start \ + --pidfile ${VARNISHD_PID_FILE} \ + --exec /usr/sbin/varnishd \ + -- -P ${VARNISHD_PID_FILE} ${VARNISHD_OPTS} &> /dev/null eend $? if [ "${VARNISHNCSA_ARGS}" != "" ]; then ebegin "Starting varnish logging" - start-stop-daemon --quiet --start --pidfile /var/run/varnishncsa.pid --exec /usr/bin/varnishncsa -- -D -P /var/run/varnishncsa.pid ${VARNISHNCSA_ARGS} + start-stop-daemon --quiet --start \ + --pidfile ${VARNISHNCSA_PID_FILE} \ + --exec /usr/bin/varnishncsa \ + -- -D -P ${VARNISHNCSA_PID_FILE} ${VARNISHNCSA_ARGS} eend $? fi } stop() { ebegin "Stopping varnish" - start-stop-daemon --quiet --stop --pidfile /var/run/varnishd.pid + start-stop-daemon --quiet --stop --pidfile ${VARNISHD_PID_FILE} eend $? - if [ -e /var/run/varnishncsa.pid ]; then + if [ -e ${VARNISHNCSA_PID_FILE} ]; then ebegin "Stopping varnish logging" - start-stop-daemon --quiet --stop --pidfile /var/run/varnishncsa.pid + start-stop-daemon --quiet --stop --pidfile ${VARNISHNCSA_PID_FILE} eend $? fi } @@ -47,7 +56,7 @@ reload() { # reload new one NOW=$(date +%Y%m%d-%H%M%S-%s) - /usr/bin/varnishadm -T $ADMINHOSTPORT vcl.load reload-$NOW $CFG_FILE > /dev/null + /usr/bin/varnishadm -T $ADMINHOSTPORT vcl.load reload-$NOW ${VARNISH_CONF} > /dev/null /usr/bin/varnishadm -T $ADMINHOSTPORT vcl.use reload-$NOW > /dev/null eend $? |