Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
Stig Sandbeck Mathisen writes: > Michael Stapelberg writes: > >> Yet another alternative might be (and it pains me to say that, but >> maybe it’s required to not break people’s setups) to have the service >> file start a wrapper shell script which evaluates >> /etc/default/varnish before starting varnish. > > That could actually be done when upgrading the package from whatever > is in stable currently. > > For instance: If upgrading from 4.0.2-1, add a > /etc/systemd/system/varnish.service.d/upgrade.conf with such a shell > wrapper for people upgrading from the version in current stable. Hm, after bootstrapping a stable debian installation, it looks like the varnish systemd unit on stable didn't use an environment file at all. It did, however, have ExecReload= set, using the reload-vcl script which I'm not very content with. Therefore, I think this issue can be resolved with just removing "ExecReload=/usr/share/varnish/reload-vcl" from the systemd unit again, and not have a "reload" action at all. This has also been discussed previously at https://github.com/varnishcache/pkg-varnish-cache/issues/30 for the upstream packaging. -- Stig Sandbeck Mathisen https://fnord.no/
Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
That sounds like a good idea! On Wed, Mar 1, 2017 at 9:04 PM, Stig Sandbeck Mathisen wrote: > Michael Stapelberg writes: > > > Yet another alternative might be (and it pains me to say that, but > > maybe it’s required to not break people’s setups) to have the service > > file start a wrapper shell script which evaluates /etc/default/varnish > > before starting varnish. > > That could actually be done when upgrading the package from whatever is > in stable currently. > > For instance: If upgrading from 4.0.2-1, add a > /etc/systemd/system/varnish.service.d/upgrade.conf with such a shell > wrapper for people upgrading from the version in current stable. > > Oh, and "ick!", but thanks. :) > > I'd really like to avoid keeping /etc/default/* around for new installs. > > -- > Stig Sandbeck Mathisen > https://fnord.no/ > -- Best regards, Michael
Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
Michael Stapelberg writes: > Yet another alternative might be (and it pains me to say that, but > maybe it’s required to not break people’s setups) to have the service > file start a wrapper shell script which evaluates /etc/default/varnish > before starting varnish. That could actually be done when upgrading the package from whatever is in stable currently. For instance: If upgrading from 4.0.2-1, add a /etc/systemd/system/varnish.service.d/upgrade.conf with such a shell wrapper for people upgrading from the version in current stable. Oh, and "ick!", but thanks. :) I'd really like to avoid keeping /etc/default/* around for new installs. -- Stig Sandbeck Mathisen https://fnord.no/
Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
Michael Stapelberg writes: > Hi, > > Gregory Colpart writes: >> tags 749272 - wontfix >> severity 749272 serious >> retitle 749272 varnish doesn't source /etc/default/varnish when started but >> uses it when reloaded > > This bug’s severity now results in varnish and, transitively, > freeradius being removed from testing, so it warrants timely > action. Whether that’s a downgrade or a fix is up to the package > maintainers (ssm?). > > FWIW, I think the request to load environment variable files is > reasonable. It’s not idiomatic for systemd, but it is a widely used > technique in Debian and will smoothen the transition for our users. A problem with /etc/default/varnish is that it is a shell script fragment, with examples using interpolation, and not just key=value statements. If someone has used "Alternative 3" for Varnish from that file, the "reload" script will still fail when using systemd. I think a fix for this issue may be: * remove the reload action from systemd. * Possibly patch the reload script to ensure it does not attempt to run when using systemd, by checking for the presence of "/run/systemd/system" and exit with a message if it is present. I wrote that reload-vcl script long ago, and it has developed other problems as varnish has developed, and probably needs to be rewritten from scratch. It needs to synchronize its varnishd command line option parser with what varnishd may possibly use, and that was last done a long time ago. "What should the varnish service actually reload when told to reload" has multiple options. The VCL file used when starting up? The compiled VCL from starting up? The VCL file last loaded, etc. -- Stig Sandbeck Mathisen https://fnord.no/
Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
Yet another alternative might be (and it pains me to say that, but maybe it’s required to not break people’s setups) to have the service file start a wrapper shell script which evaluates /etc/default/varnish before starting varnish. On Wed, Mar 1, 2017 at 7:29 AM, Stig Sandbeck Mathisen wrote: > Michael Stapelberg writes: > > > Hi, > > > > Gregory Colpart writes: > >> tags 749272 - wontfix > >> severity 749272 serious > >> retitle 749272 varnish doesn't source /etc/default/varnish when started > but uses it when reloaded > > > > This bug’s severity now results in varnish and, transitively, > > freeradius being removed from testing, so it warrants timely > > action. Whether that’s a downgrade or a fix is up to the package > > maintainers (ssm?). > > > > FWIW, I think the request to load environment variable files is > > reasonable. It’s not idiomatic for systemd, but it is a widely used > > technique in Debian and will smoothen the transition for our users. > > A problem with /etc/default/varnish is that it is a shell script > fragment, with examples using interpolation, and not just key=value > statements. If someone has used "Alternative 3" for Varnish from that > file, the "reload" script will still fail when using systemd. > > I think a fix for this issue may be: > > * remove the reload action from systemd. > > * Possibly patch the reload script to ensure it does not attempt to run > when using systemd, by checking for the presence of > "/run/systemd/system" and exit with a message if it is present. > > I wrote that reload-vcl script long ago, and it has developed other > problems as varnish has developed, and probably needs to be rewritten > from scratch. > > It needs to synchronize its varnishd command line option parser with > what varnishd may possibly use, and that was last done a long time ago. > > "What should the varnish service actually reload when told to reload" > has multiple options. The VCL file used when starting up? The compiled > VCL from starting up? The VCL file last loaded, etc. > > -- > Stig Sandbeck Mathisen > https://fnord.no/ > -- Best regards, Michael
Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
Hi, Gregory Colpart writes: > tags 749272 - wontfix > severity 749272 serious > retitle 749272 varnish doesn't source /etc/default/varnish when started but > uses it when reloaded This bug’s severity now results in varnish and, transitively, freeradius being removed from testing, so it warrants timely action. Whether that’s a downgrade or a fix is up to the package maintainers (ssm?). FWIW, I think the request to load environment variable files is reasonable. It’s not idiomatic for systemd, but it is a widely used technique in Debian and will smoothen the transition for our users. In case I don’t hear from any package maintainer until 2017-03-04, I will upload a delayed NMU (applying the supplied patch) and file an unblock request in order to prevent removal from testing. Thanks! -- Best regards, Michael
Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
tags 749272 - wontfix severity 749272 serious retitle 749272 varnish doesn't source /etc/default/varnish when started but uses it when reloaded Hello, Keeping file /etc/default/varnish when Varnish doesn't source it is confusing for users. And the worst is that the script /usr/share/varnish/reload-vcl (used by ExecReload in systemd unit) sources /etc/default/varnish ! Then users need to configure Varnish options in /etc/default/varnish *and* in varnish.service... and keep synchronized. The result is often a production failure when "systemctl reload varnish" then I consider this bug as serious severity (and it should be fixed for Stretch). There could be two bug fixes : - Using patch in this bug report to source /etc/default/varnish in varnish.service (and removing useless variables like START=yes) - Rewriting the script reload-vcl to not use /etc/default/varnish (and removing the file /etc/default/varnish) Regards, -- Grégory Colpart GnuPG:4096R/B8612B5D Evolix - Hébergement et Infogérance Open Source http://www.evolix.fr/
Bug#749272: [Pkg-varnish-devel] Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
On Monday 26 May 2014 09:54:10 Stig Sandbeck Mathisen wrote: Hi, > I'll tag this as a "wishlist+wontfix" bug, and keep it open while waiting > for policy around the use of /etc/default from systemd, upstart, and other > init systems to settle. Ack'd. Thanks! -- Glennie Vignarajah http://www.glennie.fr
Bug#749272: [Pkg-varnish-devel] Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
Control: tag -1 + wontfix Control: severity -1 wishlist On Sun, May 25, 2014 at 09:23:01PM +0200, Glennie Vignarajah wrote: > When varnish is started via systemd, it doesn't use configuration from > /etc/default/varnish (config section: Alternative 2). In order to use the > configuration from /etc/default/varnish, varnish.service should include > "EnvironmentFile=/etc/default/varnish" under [Service] section. Hello, and thanks for the bug report. /etc/default/varnish is used by /etc/init.d/varnish exclusively on purpose. If you want to use /etc/default/varnish on your own, you can override /lib/systemd/system/varnish.service in /etc/systemd/system/varnish.service, but I'll recommend you just write the wanted commandline options in /etc/systemd/system/varnish.service, instead of reading /etc/default/varnish I've documented this in /etc/default/varnish, please see the top "Note:" in http://anonscm.debian.org/gitweb/?p=pkg-varnish/pkg-varnish.git;a=blob;f=debian/varnish.default;h=68b7da41555f924a7a984296de6f523683866f40;hb=e8143261b6a3b1f8864890ff43b90585c17115ad I'll tag this as a "wishlist+wontfix" bug, and keep it open while waiting for policy around the use of /etc/default from systemd, upstart, and other init systems to settle. -- Stig Sandbeck Mathisen -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#749272: varnish doesn't source /etc/default/varnish when started with systemd
Package: varnish Version: 4.0.0-2 Severity: normal Tags: patch Hi, When varnish is started via systemd, it doesn't use configuration from /etc/default/varnish (config section: Alternative 2). In order to use the configuration from /etc/default/varnish, varnish.service should include "EnvironmentFile=/etc/default/varnish" under [Service] section. The attached patch corrects the issue. Regards, -- System Information: Debian Release: jessie/sid APT prefers unstable APT policy: (990, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.14-1-amd64 (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages varnish depends on: ii adduser 3.113+nmu3 ii gcc 4:4.8.2-4 ii init-system-helpers 1.18 ii libc6 2.18-6 ii libc6-dev [libc-dev] 2.18-6 ii libedit2 3.1-20140213-1 ii libjemalloc1 3.6.0-1 ii libncurses5 5.9+20140118-1 ii libpcre3 1:8.31-5 ii libtinfo5 5.9+20140118-1 ii libvarnishapi14.0.0-2 varnish recommends no packages. Versions of packages varnish suggests: pn varnish-doc -- Configuration Files: /etc/default/varnish changed [not included] /etc/init.d/varnish changed [not included] /etc/varnish/default.vcl changed [not included] -- debconf-show failed -- debsums errors found: debsums: changed file /lib/systemd/system/varnish.service (from varnish package) --- a/varnish.service 2014-05-25 20:31:18.224666757 +0200 +++ b/varnish.service 2014-05-25 20:29:09.415647522 +0200 @@ -5,8 +5,9 @@ Type=forking LimitNOFILE=131072 LimitMEMLOCK=82000 +EnvironmentFile=/etc/default/varnish ExecStartPre=/usr/sbin/varnishd -C -f /etc/varnish/default.vcl -ExecStart=/usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m +ExecStart=/usr/sbin/varnishd $DAEMON_OPTS ExecReload=/usr/share/varnish/reload-vcl [Install]