[Bug 1573561] Re: /etc/default/varnish is ignored (fixed values in systemd service)
So, as noted, I disagree with Stig's assertions. I think it's better for the distribution to provide the service in a way that includes discoverable ways to adjust common commandline parameters. Varnish doesn't really give us a file like /etc/varnish.conf for things like listen port parameters so the sysconfig EnvironmentFile method gives us the next best thing. Your approach requires a deliberate override of the packaged service unit which could have potentially undesirable effects in the future. As a qualified and experienced RPM maintainer I do not understand your aversion to using EnvironmentFile for it's intended purpose, or your desire for a more troublesome user experience inherent to the alternative. We shouldn't need such dramatic and [subjectively] non-intuitive workarounds to effect routine configuration of your package. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1573561 Title: /etc/default/varnish is ignored (fixed values in systemd service) To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1573561/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1573561] Re: /etc/default/varnish is ignored (fixed values in systemd service)
I strongly recommend you to use a way to configure your service in a way as to keep the entire commandline in one place, instead of keeping it in several files. Environmentfiles are good for giving a running service environment variables for it to use after startup. I do not recommend using it for creating commandlines when there are other options available. With sysvinit it was the least-worst option. If you _do_ want to split the options into another file, and you use systemd, please consider adding a /etc/systemd/system/varnish.service.d /read-options-from-environment.conf with: [Service] # at least one of... EnvironmentFile=-/etc/sysconfig/varnish EnvironmentFile=-/etc/default/varnish EnvironmentFile=-/etc/varnish/environment # Reset and set commandline ExecStart= ExecStart=/usr/sbin/varnishd $OPTIONS Also, look at man:systemd.service(5) for how systemd parses whitespace inside variables for constructing command line arguments. You may need to add several option variables if some arguments contain whitespace. Also, I do not think you should blame systemd for this. As the package maintainer, _I_ discourage the use of EnviromentFile= for command line arguments. Systemd does not, and documents it rather well. You are free to use both ways to configure your service, and you can add a service configuration fragment to do so if you like. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1573561 Title: /etc/default/varnish is ignored (fixed values in systemd service) To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1573561/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1573561] Re: /etc/default/varnish is ignored (fixed values in systemd service)
I disagree with this approach. A given daemon will have command line options that are imperative for proper operation as a daemon, and it will have command line options for behavior of the service once daemonized. If you have to invoke the daemon with ie `--daemonize` then it makes sense to have that "hardcoded" in ExecStart. If the options affect runtime behavior but can be changed without breaking the way the service is instantiated, they should be declared in an environment file. The cited github issue is going in the wrong direction, this kind of thing is what EnvironmentFile is for. I am very skeptical that upstream systemd discourages the use of EnvironmentFile in this way... Please take a look at https://src.fedoraproject.org/rpms/varnish/blob/master/f/varnish.service and https://src.fedoraproject.org/rpms/varnish/blob/master/f/varnish.params for some guidance on using EnvironmentFile for this use case. I really do not like the idea of overriding packaged configuration files to ie change the listening or allocate more memory ( read: routine administration of the software ). -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1573561 Title: /etc/default/varnish is ignored (fixed values in systemd service) To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1573561/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1573561] Re: /etc/default/varnish is ignored (fixed values in systemd service)
** Changed in: varnish (Ubuntu) Importance: Undecided => Medium ** Also affects: hundredpapercuts Importance: Undecided Status: New ** Changed in: hundredpapercuts Status: New => Confirmed ** Changed in: hundredpapercuts Importance: Undecided => Medium -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1573561 Title: /etc/default/varnish is ignored (fixed values in systemd service) To manage notifications about this bug go to: https://bugs.launchpad.net/hundredpapercuts/+bug/1573561/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1573561] Re: /etc/default/varnish is ignored (fixed values in systemd service)
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: varnish (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1573561 Title: /etc/default/varnish is ignored (fixed values in systemd service) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/varnish/+bug/1573561/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1573561] Re: /etc/default/varnish is ignored (fixed values in systemd service)
Yes, /etc/default/varnish is obsolete and should be discarded. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1573561 Title: /etc/default/varnish is ignored (fixed values in systemd service) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/varnish/+bug/1573561/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1573561] Re: /etc/default/varnish is ignored (fixed values in systemd service)
Thats a good hint, Knut. However on Ubuntu's side, the /etc/default/varnish file should disappear as it only creates confusion. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1573561 Title: /etc/default/varnish is ignored (fixed values in systemd service) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/varnish/+bug/1573561/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1573561] Re: /etc/default/varnish is ignored (fixed values in systemd service)
Hi, Use a systemd drop-in config snippet. This will override only the relevant lines. Ref. https://github.com/varnish/Varnish-Cache/pull/92# -- Best regards, Knut -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1573561 Title: /etc/default/varnish is ignored (fixed values in systemd service) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/varnish/+bug/1573561/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs