Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start if daemon is on with systemd #38

Closed
deimosfr opened this issue Feb 26, 2015 · 3 comments
Closed

Can't start if daemon is on with systemd #38

deimosfr opened this issue Feb 26, 2015 · 3 comments

Comments

@deimosfr
Copy link
Contributor

Hi,

I'm trying to get it working with Debian Jessie. However, with systemd there's an issue when daemon is set to "on":

Feb 26 17:58:45 vm sudo[5522]: pam_unix(sudo:session): session closed for user root
Feb 26 17:58:45 vm sudo[5529]: vagrant : TTY=unknown ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/sh -c echo SUDO-SUCCESS-lkyorsvjl
Feb 26 17:58:45 vm sudo[5529]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 26 17:58:45 vm ansible-<stdin>[5531]: Invoked with name=nginx pattern=None enabled=True state=started sleep=None arguments= runle
Feb 26 17:58:45 vm nginx[5563]: nginx: [emerg] "daemon" directive is duplicate in /etc/nginx/nginx.conf:51
Feb 26 17:58:45 vm nginx[5563]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 26 17:58:45 vm systemd[1]: nginx.service: control process exited, code=exited status=1
Feb 26 17:58:45 vm systemd[1]: Failed to start A high performance web server and a reverse proxy server.
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has failed.
-- 
-- The result is failed.
Feb 26 17:58:45 vm systemd[1]: Unit nginx.service entered failed state.
Feb 26 17:58:45 vm sudo[5529]: pam_unix(sudo:session): session closed for user root

Trying to find the way to make it work

@deimosfr
Copy link
Contributor Author

I've found the issue. On Debian Jessie, it looks like you simply can't disable the daemon. You can see the systemd configuration file (/lib/systemd/system/nginx.service) the override:

ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid

So when the templates tries to add the daemon directive line, it fails.

I'm going to provide a pull request for it. However, no way to disable it because of this.

@deimosfr
Copy link
Contributor Author

A pull request have been open to correct the issue #39

@jdauphant
Copy link
Owner

Ticket resolved by #39

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

No branches or pull requests

2 participants