saltstack-formulas / varnish-formula

Home Page:http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debian 8 and systemd

madssj opened this issue · comments

So, on a fresh install on a debian 8 machine, this formular breaks.

It seems, that the varnish package (correctly) doesn't use SysV style services, but systemd. I made a file stub for the systemd service, but would like to know how you think this should be handled?

This might be related to upstream, paging @whiteinge and @UtahDave

On Jul 30, 2015, at 9:15 AM, Mads Sülau Jørgensen notifications@github.com wrote:

So, on a fresh install on a debian 8 machine, this formular breaks.

It seems, that the varnish package (correctly) doesn't use SysV style services, but systemd. I made a file stub for the systemd service, but would like to know how you think this should be handled?


Reply to this email directly or view it on GitHub #8.

@puneetk the upstream package handles it fine, but this salt formula does not manage the systemd service files, as it should.

I don't see that this formula is managing the varnish init scripts at all. @puneetk is saying that the debian_service module in upstream Salt has not yet been updated to add systemd support. This statement looks correct.

@madssj will you please file an issue on the main Salt repository for this?

@whiteinge it doesn't. But it does manage the defaults file for varnish. The defaults files are not used on debian with systemd, so in that case this formular needs another way of managing those settings.

So while there might be an issue with salt itself, this particular issue is not it. Agreed?

Thanks for the clarification.

In that case conditionals for Debian 8 need to be added to the map file describing which files to use for 8 and which files to use for previous versions. There are many ways to go about this depending on what the exact changes are. The node-formula has one possible technique using if-statements, the snmmp-formula uses an addtitional map dictionary for the last-mile config. Does that answer your question in the OP?

Well that's the thing. You don't necessarily run systemd because you run Debian 8, which I think it's also true for other OSes. So how to detect which in init system is being used is the real question.

The file management should be pretty straight forward.

I'd check the name of pid 1. I'll make a PR soon. Thanks.

As discussed here https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749272 I believe that the formula could deploy a custom /etc/systemd/system/varnish.service file.

@arthurlogilab isn't #14 the right way? if so review it or merge it?

@aboe76 I hadn't seen that pull request, it's interesting. I have a different implementation in the works on my fork https://github.com/arthurlogilab/varnish-formula/

@bogdanr 's contribution is 1) missing the custom pillars as they are defined in the example (malloc is hardcoded to 1G) 2) in my opinion /etc/default/varnish should be untouched to avoid confusion so adding varnish.systemd would not be my choice of design. (the following comment is in /etc/default/varnish on debian jessie # Note: If systemd is installed, this file is obsolete and ignored.

arthurzenika@3d3bf3d shows a slightly different approach

@aboe76 Not exactly. See my comment in #14 for more explanation.

@madssj You are looking for systemd drop-in units functionality. You can override statements in a systemd service unit using a drop-in. I'd recommend managing the drop-in unit in your own states.

@arthurlogilab can you create a pull request?