Commit 44fe858e authored by Lasse Karstensen's avatar Lasse Karstensen

Retire varnishlog init scripts in rpm files.

It doesn't make sense, drinking from the firehose like that.
parent da5cfe2e
/var/log/varnish/varnish.log {
daily
rotate 7
compress
delaycompress
missingok
postrotate
/bin/kill -HUP `cat /var/run/varnishlog.pid /run/varnishlog/varnishlog.pid 2>/dev/null` 2> /dev/null || true
endscript
}
/var/log/varnish/varnishncsa.log {
daily
rotate 7
......
......@@ -19,8 +19,6 @@ Source3: varnish.logrotate
Source4: varnish_reload_vcl
Source5: varnish.params
Source6: varnish.service
Source7: varnishlog.initrc
Source8: varnishlog.service
Source9: varnishncsa.initrc
Source10: varnishncsa.service
Source11: find-provides
......@@ -127,7 +125,7 @@ make %{?_smp_mflags} V=1
sed -i 's,--pidfile \$pidfile,,g;
s,status -p \$pidfile,status,g;
s,killproc -p \$pidfile,killproc,g' \
varnish.initrc varnishlog.initrc varnishncsa.initrc
varnish.initrc varnishncsa.initrc
%endif
# In 4.0 the built docs need to be copied to the current/4.1 location.
......@@ -180,13 +178,11 @@ mkdir -p %{buildroot}%{_unitdir}
install -D -m 0644 varnish.service %{buildroot}%{_unitdir}/varnish.service
install -D -m 0644 varnish.params %{buildroot}%{_sysconfdir}/varnish/varnish.params
install -D -m 0644 varnishncsa.service %{buildroot}%{_unitdir}/varnishncsa.service
install -D -m 0644 varnishlog.service %{buildroot}%{_unitdir}/varnishlog.service
sed -i 's,sysconfig/varnish,varnish/varnish.params,' varnish_reload_vcl
# default is standard sysvinit
%else
install -D -m 0644 varnish.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/varnish
install -D -m 0755 varnish.initrc %{buildroot}%{_initrddir}/varnish
install -D -m 0755 varnishlog.initrc %{buildroot}%{_initrddir}/varnishlog
install -D -m 0755 varnishncsa.initrc %{buildroot}%{_initrddir}/varnishncsa
%endif
install -D -m 0755 varnish_reload_vcl %{buildroot}%{_sbindir}/varnish_reload_vcl
......@@ -216,14 +212,12 @@ rm -rf %{buildroot}
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%{_unitdir}/varnish.service
%{_unitdir}/varnishncsa.service
%{_unitdir}/varnishlog.service
%config(noreplace)%{_sysconfdir}/varnish/varnish.params
# default is standard sysvinit
%else
%config(noreplace) %{_sysconfdir}/sysconfig/varnish
%{_initrddir}/varnish
%{_initrddir}/varnishlog
%{_initrddir}/varnishncsa
%endif
......@@ -259,7 +253,6 @@ exit 0
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%else
/sbin/chkconfig --add varnish
/sbin/chkconfig --add varnishlog
/sbin/chkconfig --add varnishncsa
%endif
test -f /etc/varnish/secret || (uuidgen > /etc/varnish/secret && chmod 0600 /etc/varnish/secret)
......@@ -291,7 +284,6 @@ if [ $1 -lt 1 ]; then
/sbin/service varnishlog stop > /dev/null 2>&1
/sbin/service varnishncsa stop > /dev/null 2>%1
/sbin/chkconfig --del varnish
/sbin/chkconfig --del varnishlog
/sbin/chkconfig --del varnishncsa
%endif
fi
......
#! /bin/sh
#
# Control the Varnish Cache raw logging daemon
#
# chkconfig: - 90 10
# description: Varnish Cache raw logging daemon
# processname: varnishlog
# config:
# pidfile: /var/run/varnishlog.pid
### BEGIN INIT INFO
# Provides: varnishlog
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start:
# Default-Stop:
# Short-Description: start and stop varnishlog
# Description: Varnish Cache raw logging daemon
### END INIT INFO
# Source function library.
. /etc/init.d/functions
retval=0
pidfile="/var/run/varnishlog.pid"
lockfile="/var/lock/subsys/varnishlog"
logfile="/var/log/varnish/varnish.log"
exec="/usr/bin/varnishlog"
prog="varnishlog"
DAEMON_OPTS="-a -w $logfile -D -P $pidfile"
# Include varnishlog defaults
[ -e /etc/sysconfig/varnishlog ] && . /etc/sysconfig/varnishlog
start() {
if [ ! -x $exec ]
then
echo $exec not found
exit 5
fi
echo -n "Starting varnish logging daemon: "
daemon --pidfile $pidfile $exec "$DAEMON_OPTS"
echo
return $retval
}
stop() {
echo -n "Stopping varnish logging daemon: "
killproc -p $pidfile $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
status -p $pidfile $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
# See how we were called.
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?
[Unit]
Description=Varnish Cache HTTP accelerator logging daemon
After=varnish.service
[Service]
RuntimeDirectory=varnishlog
Type=forking
PIDFile=/run/varnishlog/varnishlog.pid
User=varnishlog
Group=varnish
ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log -D -P /run/varnishlog/varnishlog.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment