varnishctl?
Dridi Boukelmoune
dridi.boukelmoune at zenika.com
Mon Jan 27 16:10:14 CET 2014
Hi,
On Mon, Jan 27, 2014 at 2:57 PM, Tollef Fog Heen
<tfheen at varnish-software.com> wrote:
> Hi all,
>
> This got triggered by bug #1415 which asks for init scripts to be able
> to verify you're not just breaking your cache on a restart. I can see
> the need for such a tool, but I think it should have a bit wider scope.
>
> Problems:
>
> - you don't want to restart Varnish when the configuration is
> obviously broken.
>
> - it should be possible to reload configurations without having to
> fiddle with vcl.load, vcl.use. Coming up with new names is
> surprisingly annoying.
>
> - Duplication of logic between RH and Debian init scripts. Varnish
> should probably be able to read a parameter file in some reasonable
> format, which will also make the transition to non-sysvinit inits
> easier.
>
> Suggestion 1:
>
> Write something like to apachectl. It knows how to run a config test,
> start and stop the management process. It makes it easy to run
> multiple instances (something that's more important to apache than
> us). It's a bit like a distro-independent init script, but has custom
> functions (configtest for instance)
I find the idea compelling, but I've had issues with apachectl.
The man page talks about a SysV mode [1], but apachectl uses different
semantics. For instance, a restart for SysV [2] will actually stop the
process, where apachectl will send a signal [3] to the daemon that
will somewhat reload itself. I've found this really misleading, the
first time I've had to use it.
I really like the idea of a varnishctl that could be used downstream
to build services on top of systemd, upstart etc. But I'd go for a
simple pass-through command with simple sub-commands such as
start/stop/restart/reload/configtest that would just add sugar such as
"configtest on restart" and nothing more.
On my Fedora laptop, apachectl has been rewritten to use systemd, so
this problems would probably not occur.
> Suggestion 2:
>
> Extend varnishadm to not only be able to talk to varnishd, but also
> start and stop the management process, do a config test and so on.
Would that mean 3 processes in varnishd ?
> Probably also extend varnishd to be able to reload the VCL somehow and
> make it able to read parameters from a file.
>
> I'm willing to work on 1. I think it'd be fairly easy to do and keeps
> the existing tools doing one thing well.
>
> Input, opinions, etc?
I like the idea of a varnishctl utility, but please don't make it as
confusing as apachectl :)
Dridi
[1] https://httpd.apache.org/docs/2.4/programs/apachectl.html
[2] can't find the docs, pretty sure restart must stop the process
[3] https://httpd.apache.org/docs/2.4/en/stopping.html
> --
> Tollef Fog Heen
> Technical lead | Varnish Software AS
> 📞: +47 21 98 92 64
> We Make Websites Fly!
>
> _______________________________________________
> varnish-dev mailing list
> varnish-dev at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
More information about the varnish-dev
mailing list