Blame SOURCES/varnish.scl.patch

f9e5b4
diff --git a/configure b/configure
f9e5b4
index 59d0c01..561da34 100755
f9e5b4
--- a/configure
f9e5b4
+++ b/configure
f9e5b4
@@ -16699,7 +16699,7 @@ fi
f9e5b4
 LIBS="${save_LIBS}"
f9e5b4
 
f9e5b4
 # Run-time directory
f9e5b4
-VARNISH_STATE_DIR='${localstatedir}/varnish'
f9e5b4
+VARNISH_STATE_DIR='${localstatedir}/$rhsclpkgname'
f9e5b4
 
f9e5b4
 
f9e5b4
 # Default configuration directory.
f9e5b4
diff --git a/configure.ac b/configure.ac
f9e5b4
index bbe9da2..ce08a41 100644
f9e5b4
--- a/configure.ac
f9e5b4
+++ b/configure.ac
f9e5b4
@@ -456,11 +456,11 @@ fi
f9e5b4
 LIBS="${save_LIBS}"
f9e5b4
 
f9e5b4
 # Run-time directory
f9e5b4
-VARNISH_STATE_DIR='${localstatedir}/varnish'
f9e5b4
+VARNISH_STATE_DIR='${localstatedir}/$rhsclpkgname'
f9e5b4
 AC_SUBST(VARNISH_STATE_DIR)
f9e5b4
 
f9e5b4
 # Default configuration directory.
f9e5b4
-varnishconfdir='${sysconfdir}/varnish'
f9e5b4
+varnishconfdir='${sysconfdir}/$rhsclpkgname'
f9e5b4
 AC_SUBST(varnishconfdir)
f9e5b4
 
f9e5b4
 # Check for linker script support
f9e5b4
diff --git a/redhat/varnish.initrc b/redhat/varnish.initrc
f9e5b4
index 082c770..a221618 100755
f9e5b4
--- a/redhat/varnish.initrc
f9e5b4
+++ b/redhat/varnish.initrc
f9e5b4
@@ -5,8 +5,8 @@
f9e5b4
 # chkconfig: - 90 10
f9e5b4
 # description: Varnish is a high-perfomance HTTP accelerator
f9e5b4
 # processname: varnishd
f9e5b4
-# config: /etc/sysconfig/varnish
f9e5b4
-# pidfile: /var/run/varnishd.pid
f9e5b4
+# config: $sysconfdir/varnish
f9e5b4
+# pidfile: $rundir/varnishd.pid
f9e5b4
 
f9e5b4
 ### BEGIN INIT INFO
f9e5b4
 # Provides: varnish
f9e5b4
@@ -23,16 +23,16 @@
f9e5b4
 . /etc/init.d/functions
f9e5b4
 
f9e5b4
 retval=0
f9e5b4
-pidfile=/var/run/varnish.pid
f9e5b4
+pidfile=$rundir/varnish.pid
f9e5b4
 
f9e5b4
-exec="/usr/sbin/varnishd"
f9e5b4
-reload_exec="/usr/sbin/varnish_reload_vcl"
f9e5b4
+exec="$sbindir/varnishd"
f9e5b4
+reload_exec="$sbindir/varnish_reload_vcl"
f9e5b4
 prog="varnishd"
f9e5b4
-config="/etc/sysconfig/varnish"
f9e5b4
-lockfile="/var/lock/subsys/varnish"
f9e5b4
+config="$sysconfdir/sysconfig/varnish"
f9e5b4
+lockfile="$localstatedir/lock/subsys/varnish"
f9e5b4
 
f9e5b4
 # Include varnish defaults
f9e5b4
-[ -e /etc/sysconfig/varnish ] && . /etc/sysconfig/varnish
f9e5b4
+[ -e $sysconfdir/sysconfig/varnish ] && . $sysconfdir/sysconfig/varnish
f9e5b4
 
f9e5b4
 
f9e5b4
 start() {
f9e5b4
@@ -66,7 +66,7 @@ start() {
f9e5b4
 		ulimit -c ${DAEMON_COREFILE_LIMIT}
f9e5b4
 	fi
f9e5b4
 
f9e5b4
-        # $DAEMON_OPTS is set in /etc/sysconfig/varnish. At least, one
f9e5b4
+        # $DAEMON_OPTS is set in $sysconfdir/varnish. At least, one
f9e5b4
         # has to set up a backend, or /tmp will be used, which is a bad idea.
f9e5b4
 	if [ "$DAEMON_OPTS" = "" ]; then
f9e5b4
 		echo "\$DAEMON_OPTS empty."
f9e5b4
@@ -74,7 +74,7 @@ start() {
f9e5b4
 		return 6
f9e5b4
 	else
f9e5b4
 		# Varnish always gives output on STDOUT
f9e5b4
-		daemon --pidfile $pidfile  $exec -P $pidfile "$DAEMON_OPTS" > /dev/null 2>&1
f9e5b4
+		daemon --pidfile $pidfile  $exec -P $pidfile "$DAEMON_OPTS" > /dev/null
f9e5b4
 		retval=$?
f9e5b4
 		if [ $retval -eq 0 ]
f9e5b4
 		then
f9e5b4
diff --git a/redhat/varnish.logrotate b/redhat/varnish.logrotate
f9e5b4
index 535614d..7387665 100644
f9e5b4
--- a/redhat/varnish.logrotate
f9e5b4
+++ b/redhat/varnish.logrotate
f9e5b4
@@ -1,10 +1,10 @@
f9e5b4
-/var/log/varnish/*.log {
f9e5b4
+$logdir/*.log {
f9e5b4
     missingok
f9e5b4
     notifempty
f9e5b4
     sharedscripts
f9e5b4
     delaycompress
f9e5b4
     postrotate
f9e5b4
-        /bin/kill -HUP `cat /var/run/varnishlog.pid 2>/dev/null` 2> /dev/null || true
f9e5b4
-	/bin/kill -HUP `cat /var/run/varnishncsa.pid 2>/dev/null` 2> /dev/null || true
f9e5b4
+        /bin/kill -HUP `cat $rundir/varnishlog.pid 2>/dev/null` 2> /dev/null || true
f9e5b4
+	/bin/kill -HUP `cat $rundir/varnishncsa.pid 2>/dev/null` 2> /dev/null || true
f9e5b4
     endscript
f9e5b4
 }
f9e5b4
diff --git a/redhat/varnish.params b/redhat/varnish.params
f9e5b4
index 27a14dd..3f3f4d5 100644
f9e5b4
--- a/redhat/varnish.params
f9e5b4
+++ b/redhat/varnish.params
f9e5b4
@@ -5,7 +5,7 @@
f9e5b4
 RELOAD_VCL=1
f9e5b4
 
f9e5b4
 # Main configuration file. You probably want to change it.
f9e5b4
-VARNISH_VCL_CONF=/etc/varnish/default.vcl
f9e5b4
+VARNISH_VCL_CONF=$sysconfdir/varnish/default.vcl
f9e5b4
 
f9e5b4
 # Default address and port to bind to. Blank address means all IPv4
f9e5b4
 # and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted
f9e5b4
@@ -18,11 +18,11 @@ VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
f9e5b4
 VARNISH_ADMIN_LISTEN_PORT=6082
f9e5b4
 
f9e5b4
 # Shared secret file for admin interface
f9e5b4
-VARNISH_SECRET_FILE=/etc/varnish/secret
f9e5b4
+VARNISH_SECRET_FILE=$sysconfdir/varnish/secret
f9e5b4
 
f9e5b4
 # Backend storage specification, see Storage Types in the varnishd(5)
f9e5b4
 # man page for details.
f9e5b4
-VARNISH_STORAGE="file,/var/lib/varnish/varnish_storage.bin,1G"
f9e5b4
+VARNISH_STORAGE="file,$localstatedir/lib/$name/varnish_storage.bin,1G"
f9e5b4
 
f9e5b4
 # Default TTL used when the backend does not specify one
f9e5b4
 VARNISH_TTL=120
f9e5b4
diff --git a/redhat/varnish.service b/redhat/varnish.service
f9e5b4
index a4f3355..f4abd09 100644
f9e5b4
--- a/redhat/varnish.service
f9e5b4
+++ b/redhat/varnish.service
f9e5b4
@@ -6,10 +6,10 @@ After=syslog.target network.target
f9e5b4
 
f9e5b4
 #
f9e5b4
 # If you want to make changes to this file, please copy it to 
f9e5b4
-# /etc/systemd/system/varnish.service and make your changes there.
f9e5b4
-# This will override the file kept at /lib/systemd/system/varnish.service
f9e5b4
+# /etc/systemd/system/$name.service and make your changes there.
f9e5b4
+# This will override the file kept at /lib/systemd/system/$name.service
f9e5b4
 #
f9e5b4
-# Enviroment variables may be found in /etc/varnish/varnish.params
f9e5b4
+# Enviroment variables may be found in $sysconfdir/varnish/varnish.params
f9e5b4
 #
f9e5b4
 
f9e5b4
 # Maximum number of open files (for ulimit -n)
f9e5b4
@@ -22,14 +22,13 @@ LimitMEMLOCK=82000
f9e5b4
 # Maximum size of the corefile. 
f9e5b4
 LimitCORE=infinity
f9e5b4
 
f9e5b4
-EnvironmentFile=/etc/varnish/varnish.params
f9e5b4
+EnvironmentFile=$sysconfdir/varnish/varnish.params
f9e5b4
 
f9e5b4
 Type=forking
f9e5b4
-PIDFile=/var/run/varnish.pid
f9e5b4
+PIDFile=$rundir/varnish.pid
f9e5b4
 PrivateTmp=true
f9e5b4
-ExecStartPre=/usr/sbin/varnishd -C -f $VARNISH_VCL_CONF
f9e5b4
-ExecStart=/usr/sbin/varnishd \
f9e5b4
-	-P /var/run/varnish.pid \
f9e5b4
+ExecStart=$sbindir/varnishd \
f9e5b4
+	-P $rundir/varnish.pid \
f9e5b4
 	-f $VARNISH_VCL_CONF \
f9e5b4
 	-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
f9e5b4
 	-T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
f9e5b4
@@ -40,7 +39,7 @@ ExecStart=/usr/sbin/varnishd \
f9e5b4
 	-s $VARNISH_STORAGE \
f9e5b4
 	$DAEMON_OPTS
f9e5b4
 
f9e5b4
-ExecReload=/usr/sbin/varnish_reload_vcl
f9e5b4
+ExecReload=$sbindir/varnish_reload_vcl
f9e5b4
 
f9e5b4
 [Install]
f9e5b4
 WantedBy=multi-user.target
f9e5b4
diff --git a/redhat/varnish.sysconfig b/redhat/varnish.sysconfig
f9e5b4
index 6aa2354..41b68d8 100644
f9e5b4
--- a/redhat/varnish.sysconfig
f9e5b4
+++ b/redhat/varnish.sysconfig
f9e5b4
@@ -1,6 +1,6 @@
f9e5b4
 # Configuration file for varnish
f9e5b4
 #
f9e5b4
-# /etc/init.d/varnish expects the variable $DAEMON_OPTS to be set from this
f9e5b4
+# /etc/init.d/$name expects the variable $DAEMON_OPTS to be set from this
f9e5b4
 # shell script fragment.
f9e5b4
 #
f9e5b4
 
f9e5b4
@@ -35,7 +35,7 @@ RELOAD_VCL=1
f9e5b4
 #             -T localhost:6082 \
f9e5b4
 #             -b localhost:8080 \
f9e5b4
 #             -u varnish -g varnish \
f9e5b4
-#             -s file,/var/lib/varnish/varnish_storage.bin,1G"
f9e5b4
+#             -s file,$localstatedir/$name/varnish_storage.bin,1G"
f9e5b4
 
f9e5b4
 
f9e5b4
 ## Alternative 2, Configuration with VCL
f9e5b4
@@ -46,10 +46,10 @@ RELOAD_VCL=1
f9e5b4
 #
f9e5b4
 #DAEMON_OPTS="-a :6081 \
f9e5b4
 #             -T localhost:6082 \
f9e5b4
-#             -f /etc/varnish/default.vcl \
f9e5b4
+#             -f $sysconfdir/varnish/default.vcl \
f9e5b4
 #             -u varnish -g varnish \
f9e5b4
-#             -S /etc/varnish/secret \
f9e5b4
-#             -s file,/var/lib/varnish/varnish_storage.bin,1G"
f9e5b4
+#             -S $sysconfdir/varnish/secret \
f9e5b4
+#             -s file,$localstatedir/lib/$name/varnish_storage.bin,1G"
f9e5b4
 
f9e5b4
 
f9e5b4
 ## Alternative 3, Advanced configuration
f9e5b4
@@ -57,7 +57,7 @@ RELOAD_VCL=1
f9e5b4
 # See varnishd(1) for more information.
f9e5b4
 #
f9e5b4
 # # Main configuration file. You probably want to change it :)
f9e5b4
-VARNISH_VCL_CONF=/etc/varnish/default.vcl
f9e5b4
+VARNISH_VCL_CONF=$sysconfdir/varnish/default.vcl
f9e5b4
 #
f9e5b4
 # # Default address and port to bind to
f9e5b4
 # # Blank address means all IPv4 and IPv6 interfaces, otherwise specify
f9e5b4
@@ -70,7 +70,7 @@ VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
f9e5b4
 VARNISH_ADMIN_LISTEN_PORT=6082
f9e5b4
 #
f9e5b4
 # # Shared secret file for admin interface
f9e5b4
-VARNISH_SECRET_FILE=/etc/varnish/secret
f9e5b4
+VARNISH_SECRET_FILE=$sysconfdir/varnish/secret
f9e5b4
 #
f9e5b4
 # # The minimum number of worker threads to start
f9e5b4
 VARNISH_MIN_THREADS=50
f9e5b4
diff --git a/redhat/varnishlog.initrc b/redhat/varnishlog.initrc
f9e5b4
index 2b5fc51..f015b12 100644
f9e5b4
--- a/redhat/varnishlog.initrc
f9e5b4
+++ b/redhat/varnishlog.initrc
f9e5b4
@@ -6,7 +6,7 @@
f9e5b4
 # description: Varnish Cache logging daemon
f9e5b4
 # processname: varnishlog
f9e5b4
 # config: 
f9e5b4
-# pidfile: /var/run/varnishlog.pid
f9e5b4
+# pidfile: $rundir/varnishlog.pid
f9e5b4
 
f9e5b4
 ### BEGIN INIT INFO
f9e5b4
 # Provides: varnishlog
f9e5b4
@@ -22,17 +22,17 @@
f9e5b4
 . /etc/init.d/functions
f9e5b4
 
f9e5b4
 retval=0
f9e5b4
-pidfile="/var/run/varnishlog.pid"
f9e5b4
-lockfile="/var/lock/subsys/varnishlog"
f9e5b4
-logfile="/var/log/varnish/varnish.log"
f9e5b4
+pidfile="$rundir/varnishlog.pid"
f9e5b4
+lockfile="$localstatedir/lock/subsys/varnishlog"
f9e5b4
+logfile="$logdir/varnish.log"
f9e5b4
 
f9e5b4
-exec="/usr/bin/varnishlog"
f9e5b4
+exec="$bindir/varnishlog"
f9e5b4
 prog="varnishlog"
f9e5b4
 
f9e5b4
 DAEMON_OPTS="-a -w $logfile -D -P $pidfile"
f9e5b4
 
f9e5b4
 # Include varnishlog defaults
f9e5b4
-[ -e /etc/sysconfig/varnishlog ] && . /etc/sysconfig/varnishlog
f9e5b4
+[ -e $sysconfdir/sysconfig/varnishlog ] && . $sysconfdir/sysconfig/varnishlog
f9e5b4
 
f9e5b4
 start() {
f9e5b4
 
f9e5b4
diff --git a/redhat/varnishlog.service b/redhat/varnishlog.service
f9e5b4
index c7a0193..91ce329 100644
f9e5b4
--- a/redhat/varnishlog.service
f9e5b4
+++ b/redhat/varnishlog.service
f9e5b4
@@ -1,11 +1,11 @@
f9e5b4
 [Unit]
f9e5b4
 Description=Varnish HTTP accelerator logging daemon
f9e5b4
-After=varnish.service
f9e5b4
+After=$name.service
f9e5b4
 
f9e5b4
 [Service]
f9e5b4
 Type=forking
f9e5b4
-PIDFile=/run/varnishlog.pid
f9e5b4
-ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log -D -P /run/varnishlog.pid
f9e5b4
+PIDFile=$rundir/varnishlog.pid
f9e5b4
+ExecStart=$bindir/varnishlog -a -w $logdir/varnish.log -D -P $rundir/varnishlog.pid
f9e5b4
 
f9e5b4
 [Install]
f9e5b4
 WantedBy=multi-user.target
f9e5b4
diff --git a/redhat/varnishncsa.initrc b/redhat/varnishncsa.initrc
f9e5b4
index b23fa48..a41d2fe 100644
f9e5b4
--- a/redhat/varnishncsa.initrc
f9e5b4
+++ b/redhat/varnishncsa.initrc
f9e5b4
@@ -22,17 +22,17 @@
f9e5b4
 . /etc/init.d/functions
f9e5b4
 
f9e5b4
 retval=0
f9e5b4
-pidfile="/var/run/varnishncsa.pid"
f9e5b4
-lockfile="/var/lock/subsys/varnishncsa"
f9e5b4
-logfile="/var/log/varnish/varnishncsa.log"
f9e5b4
+pidfile="$rundir/varnishncsa.pid"
f9e5b4
+lockfile="$localstatedir/lock/subsys/varnishncsa"
f9e5b4
+logfile="$logdir/varnishncsa.log"
f9e5b4
 
f9e5b4
-exec="/usr/bin/varnishncsa"
f9e5b4
+exec="$bindir/varnishncsa"
f9e5b4
 prog="varnishncsa"
f9e5b4
 
f9e5b4
 DAEMON_OPTS="-a -w $logfile -D -P $pidfile"
f9e5b4
 
f9e5b4
 # Include varnishncsa defaults
f9e5b4
-[ -e /etc/sysconfig/varnishncsa ] && . /etc/sysconfig/varnishncsa
f9e5b4
+[ -e $sysconfdir/sysconfig/varnishncsa ] && . $sysconfdir/sysconfig/varnishncsa
f9e5b4
 
f9e5b4
 start() {
f9e5b4
 
f9e5b4
diff --git a/redhat/varnishncsa.service b/redhat/varnishncsa.service
f9e5b4
index e2ebdcd..2d104c7 100644
f9e5b4
--- a/redhat/varnishncsa.service
f9e5b4
+++ b/redhat/varnishncsa.service
f9e5b4
@@ -1,11 +1,11 @@
f9e5b4
 [Unit]
f9e5b4
 Description=Varnish HTTP accelerator NCSA daemon
f9e5b4
-After=varnish.service
f9e5b4
+After=$name.service
f9e5b4
 
f9e5b4
 [Service]
f9e5b4
 Type=forking
f9e5b4
-PIDFile=/run/varnishncsa.pid
f9e5b4
-ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log -D -P /run/varnishncsa.pid
f9e5b4
+PIDFile=$rundir/varnishncsa.pid
f9e5b4
+ExecStart=$bindir/varnishncsa -a -w $logdir/varnishncsa.log -D -P $rundir/varnishncsa.pid
f9e5b4
 
f9e5b4
 [Install]
f9e5b4
 WantedBy=multi-user.target