as www-servers/varnish supports running multiple instances with the -n parameter it would be nice if gentoo's init script/configuration would do it too the same way as eg. packages like mysql and openvpn do... i'll look into this myself when i'll get an idea what's the right way to implement it. if the maintainer would give me a hint in the right direction i would really appreciate it ;) Reproducible: Always
(In reply to frank from comment #0) > as www-servers/varnish supports running multiple instances with the -n > parameter it would be nice if gentoo's init script/configuration would do it > too the same way as eg. packages like mysql and openvpn do... > i'll look into this myself when i'll get an idea what's the right way to > implement it. if the maintainer would give me a hint in the right direction > i would really appreciate it ;) > > Reproducible: Always It might be possible to create a bash string of named instances which we loop over and start one instance of varnish per instance. Take a look at man varnishd: -n name Specify a name for this instance. Amonst other things, this name is used to construct the name of the directory in which varnishd keeps temporary files and persistent state. If the specified name begins with a forward slash, it is interpreted as the absolute path to the directory which should be used for this purpose. So the bash would look something like: INSTANCES="a b c" for i in $INSTANCES ; do echo "pretending to start varnishd -n $i" done Give it a go, see where you get.
Created attachment 362810 [details, diff] init script patch for multiple instances support i finally had some time to come back to this, so inspired by memcached's init script here we are with an improved varnishd init script... disclaimer: i ignore gentoo's rc coding guidelines so feel free to adjust it before (hopefully) applying it to the package and of course i only guarantee it works for me ;)
(In reply to frank from comment #2) > Created attachment 362810 [details, diff] [details, diff] > init script patch for multiple instances support > > i finally had some time to come back to this, so inspired by memcached's > init script here we are with an improved varnishd init script... > disclaimer: i ignore gentoo's rc coding guidelines so feel free to adjust it > before (hopefully) applying it to the package and of course i only guarantee > it works for me ;) frank, sorry for the delay in answering. Can you update and test the patch against www-servers/varnish/files/varnishd.initd-r2 since there have been some changes since you submitted the above patch. I'm not so worried about merging which I can manually figure out as the testing.
Hi Frank, please give varnish-4.0.0-r1 a try. It got some major changes and running multiple instances of either varnishd, varnishncsa and/or varnishlog should work perfectly fine now. Just link /etc/init.d/varnishd.foo -> /etc/init.d/varnishd, create a new config /etc/conf.d/varnishd.foo and adjust the config file there as well as the listening port of varnishd. The same can be done for varnishncsa and varnishlog.
(In reply to Christian Ruppert (idl0r) from comment #4) > Hi Frank, > > please give varnish-4.0.0-r1 a try. It got some major changes and running > multiple instances of either varnishd, varnishncsa and/or varnishlog should > work perfectly fine now. > > Just link /etc/init.d/varnishd.foo -> /etc/init.d/varnishd, create a new > config /etc/conf.d/varnishd.foo and adjust the config file there as well as > the listening port of varnishd. The same can be done for varnishncsa and > varnishlog. Christian, if your satisfied with your fix, let's just close this.
I think we're done here. Reopen if this is still an issue.