Mailing List Archive

#1666: make init script check config before restarting
#1666: make init script check config before restarting
--------------------------+--------------------
Reporter: KlavsKlavsen | Type: defect
Status: new | Priority: normal
Milestone: | Component: build
Version: unknown | Severity: normal
Keywords: |
--------------------------+--------------------
Today, if I restart varnish and have made a config mistake - varnish dies
and I'm having to scramble.. :(

icinga, named, apache and other init scripts all check config BEFORE doing
restart and simply exits with an error if config check fails.

I'd very much like varnish to do the same - I'd suggest simply doing:
varnishd -C -f /etc/varnish/default.vcl
and checking return value from that.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------
Changes (by lkarsten):

* owner: => lkarsten


--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------

Comment (by lkarsten):

Discussed during bugwash today. It makes sense, and we should do this.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------

Comment (by gquintard):

I looked at how to do it in systemd, and stumbled upon this thread :
http://lists.freedesktop.org/archives/systemd-devel/2014-July/021633.html

TL;DR : there no !ExecRestartPre/!ExecRestartCheck that would allow us to
do it. Restart is just a stop and a start with no idea of context.

Maybe we can tweak varnish_vcl_reload to have a dryrun/check/fake option
that would just validate the vcl? However, that wouldn't catch errors in
the command line, but I'm not sure anything can.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:3>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------

Comment (by lkarsten):

Varnish 4.1 on el6/el7/non-systemd debians/ubuntus will do this check,
starting from today.

I haven't checked how our systemd service files handles it.

Leaving this open until we decide if this should be put into 4.0 as well.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:4>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: closed
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution: fixed
Keywords: |
--------------------------+-----------------------
Changes (by lkarsten):

* status: new => closed
* resolution: => fixed


Comment:

4.0 builds now use the same packaging files as 4.1, and have these
changes. They will be generally available with the next 4.0 release.

I don't think there is much to be done with configtest on systemd, except
for maybe supplying a separate tool for it.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:5>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: closed
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution: fixed
Keywords: |
--------------------------+-----------------------

Comment (by KlavsKlavsen):

I just verified.. its possible to make it work with systemd like this:
(example for apache)..
ExecReload=/sbin/apachectl configtest && /usr/sbin/httpd $OPTIONS -k
graceful

it catches reload.. NOT restart though. But I can make sure my
configuration management modules use reload (in case they use restart)..

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:6>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------
Changes (by KlavsKlavsen):

* status: closed => reopened
* resolution: fixed =>


--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:7>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------

Comment (by KlavsKlavsen):

I opened https://github.com/systemd/systemd/issues/2175 - in hopes of
getting a solution that would also cover service varnish restart :)

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:8>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------

Comment (by KlavsKlavsen):

update.. the ExecReload with && does not work - as it's not a shell
command being run.. so && is invalid.. my testing was faulty - since I
found that httpd actually handles faulty config itself on graceful.. (not
on restart though). hoping for a good resolution for #2175 @systemd :)

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:9>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1666: make init script check config before restarting [ In reply to ]
#1666: make init script check config before restarting
--------------------------+-----------------------
Reporter: KlavsKlavsen | Owner: lkarsten
Type: defect | Status: closed
Priority: normal | Milestone:
Component: build | Version: unknown
Severity: normal | Resolution: fixed
Keywords: |
--------------------------+-----------------------
Changes (by lkarsten):

* status: reopened => closed
* resolution: => fixed


Comment:

Hi.

Thanks for bringing this up with systemd. We might make a configtest tool
at some point, it has been discussed in the past.

Closing as there are no more actionable items here for us.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1666#comment:10>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs