<div dir="ltr">I'd like to add 2c if I may, merely as a long-time Apache and Varnish user. Whenever we hire someone who is at entry-level, they're inevitably confused by apachectl's start, stop, and restart commands for two reasons.<div>
<br></div><div>First, on many OS's (FreeBSD in particular) you never want to use apachectl to start and stop because it's only there for when the OS lacks a service control scheme such as "service apache start". Using apachectl will often load the wrong config or start only one of several instances. I'm guessing the easiest "solution" is to simply not implement start/stop/restart and let it stay a matter of OS integration.</div>
<div><br></div><div>Second, most people equate "restart" to "stop then start", and apachectl's restart does something quite different.</div><div><br></div><div>I like the suggestions in this thread, and I'd just suggest avoiding adding that same type of confusion to Varnish.</div>
<div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 27, 2014 at 9:10 AM, Dridi Boukelmoune <span dir="ltr"><<a href="mailto:dridi.boukelmoune@zenika.com" target="_blank">dridi.boukelmoune@zenika.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div><br>
On Mon, Jan 27, 2014 at 2:57 PM, Tollef Fog Heen<br>
<<a href="mailto:tfheen@varnish-software.com" target="_blank">tfheen@varnish-software.com</a>> wrote:<br>
> Hi all,<br>
><br>
> This got triggered by bug #1415 which asks for init scripts to be able<br>
> to verify you're not just breaking your cache on a restart. I can see<br>
> the need for such a tool, but I think it should have a bit wider scope.<br>
><br>
> Problems:<br>
><br>
> - you don't want to restart Varnish when the configuration is<br>
> obviously broken.<br>
><br>
> - it should be possible to reload configurations without having to<br>
> fiddle with vcl.load, vcl.use. Coming up with new names is<br>
> surprisingly annoying.<br>
><br>
> - Duplication of logic between RH and Debian init scripts. Varnish<br>
> should probably be able to read a parameter file in some reasonable<br>
> format, which will also make the transition to non-sysvinit inits<br>
> easier.<br>
><br>
> Suggestion 1:<br>
><br>
> Write something like to apachectl. It knows how to run a config test,<br>
> start and stop the management process. It makes it easy to run<br>
> multiple instances (something that's more important to apache than<br>
> us). It's a bit like a distro-independent init script, but has custom<br>
> functions (configtest for instance)<br>
<br>
</div>I find the idea compelling, but I've had issues with apachectl.<br>
<br>
The man page talks about a SysV mode [1], but apachectl uses different<br>
semantics. For instance, a restart for SysV [2] will actually stop the<br>
process, where apachectl will send a signal [3] to the daemon that<br>
will somewhat reload itself. I've found this really misleading, the<br>
first time I've had to use it.<br>
<br>
I really like the idea of a varnishctl that could be used downstream<br>
to build services on top of systemd, upstart etc. But I'd go for a<br>
simple pass-through command with simple sub-commands such as<br>
start/stop/restart/reload/configtest that would just add sugar such as<br>
"configtest on restart" and nothing more.<br>
<br>
On my Fedora laptop, apachectl has been rewritten to use systemd, so<br>
this problems would probably not occur.<br>
<div><br>
> Suggestion 2:<br>
><br>
> Extend varnishadm to not only be able to talk to varnishd, but also<br>
> start and stop the management process, do a config test and so on.<br>
<br>
</div>Would that mean 3 processes in varnishd ?<br>
<div><br>
> Probably also extend varnishd to be able to reload the VCL somehow and<br>
> make it able to read parameters from a file.<br>
><br>
> I'm willing to work on 1. I think it'd be fairly easy to do and keeps<br>
> the existing tools doing one thing well.<br>
><br>
> Input, opinions, etc?<br>
<br>
</div>I like the idea of a varnishctl utility, but please don't make it as<br>
confusing as apachectl :)<br>
<br>
Dridi<br>
<br>
[1] <a href="https://httpd.apache.org/docs/2.4/programs/apachectl.html" target="_blank">https://httpd.apache.org/docs/2.4/programs/apachectl.html</a><br>
[2] can't find the docs, pretty sure restart must stop the process<br>
[3] <a href="https://httpd.apache.org/docs/2.4/en/stopping.html" target="_blank">https://httpd.apache.org/docs/2.4/en/stopping.html</a><br>
<div><div><br>
> --<br>
> Tollef Fog Heen<br>
> Technical lead | Varnish Software AS<br>
> 📞: <a href="tel:%2B47%2021%2098%2092%2064" value="+4721989264" target="_blank">+47 21 98 92 64</a><br>
> We Make Websites Fly!<br>
><br>
> _______________________________________________<br>
> varnish-dev mailing list<br>
> <a href="mailto:varnish-dev@varnish-cache.org" target="_blank">varnish-dev@varnish-cache.org</a><br>
> <a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev</a><br>
<br>
_______________________________________________<br>
varnish-dev mailing list<br>
<a href="mailto:varnish-dev@varnish-cache.org" target="_blank">varnish-dev@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev</a></div></div></blockquote></div><br><br clear="all"><div><br></div>
-- <br>
<p>As implied by email protocols, the information in this message is not confidential. Any middle-man or recipient may inspect, modify, copy, forward, reply to, delete, or filter email for any purpose unless said parties are otherwise obligated. As the sender, I acknowledge that I have a lower expectation of the control and privacy of this message than I would a post-card. Further, nothing in this message is legally binding without cryptographic evidence of its integrity.</p>
<p><a href="http://bilbo.hobbiton.org/wiki/Eat_My_Sig" target="_blank">http://bilbo.hobbiton.org/wiki/Eat_My_Sig</a></p>
</div></div>