Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

fixing systemd issue when daemon is set to on #39

Merged
merged 1 commit into from
Feb 27, 2015
Merged

fixing systemd issue when daemon is set to on #39

merged 1 commit into from
Feb 27, 2015

Conversation

deimosfr
Copy link
Contributor

Hi,

This role is not working with systemd installed on the machine. Here is a fix.

Can you please merge it.

Thanks

@jdauphant
Copy link
Owner

Hi @deimosfr ,

Thanks for the pull request, we can do more simple and generic.
Normally this should work in templates/nginx.conf.j2 :

{% if nginx_daemon_mode == "off" %}
daemon off;
{% endif %}

Notes : by default for nginx is "daemon on".

Best regards,
Julien

@deimosfr
Copy link
Contributor Author

Hi,

Thanks for your answer. In fact no, it won't work. Because as said in the #38 ticket, if you're using systemd, you can't declare twice the "daemon" parameter. It's rejected by nginx validator.

And if you're asking why twice, it's simply because "daemon" parameter is hard coded in the systemd script of Debian Jessie :-/. So in fact, it's not "safely" possible to disable it if you're running systemd with its default given configuration on Debian Jessie :-(. The only way to make it work, is to update the systemd configuration, but It may be override by a package update and so suddenly failed on next nginx boot..

However, this fix permit to make it work if you've set it to "on".

@jdauphant
Copy link
Owner

Yes I understand, I also read the ticket.
But :

  • The variable "nginx_daemon_mode" is "on" by default on the role
    • in this case with my modification, the template doesn't declare "daemon on" in the configuration file (that should correct your problem)
  • People that use "nginx_daemon_mode: off", use nginx differently even if they have systemd in their systems
  • I am 99% sure that will work in your configuration

@deimosfr
Copy link
Contributor Author

You're right, in my configuration it will work ! However, it's a shame that we could not better cover the "off" case.

@deimosfr
Copy link
Contributor Author

Just updated with your suggestion. Can you please merge and make a new release ?

Thanks

jdauphant added a commit that referenced this pull request Feb 27, 2015
fixing systemd issue when daemon is set to on
@jdauphant jdauphant merged commit b9f0f79 into jdauphant:master Feb 27, 2015
@jdauphant
Copy link
Owner

Ok thanks @deimosfr , I just merge. I juste make the release /v1.2.1.
Also, it's not a shame for me :
If you use the "daemon off", you have to now what you do and in general it doesn't not involve an init system.

@deimosfr
Copy link
Contributor Author

ok make sense. Thanks a lot :-)

@deimosfr
Copy link
Contributor Author

Can you please update ansible galaxy as well. Thanks

@jdauphant
Copy link
Owner

It's update on ansible galaxy.

@deimosfr
Copy link
Contributor Author

Thanks it works !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants