nginxinc / nginx-ldap-auth

Example of LDAP authentication using ngx_http_auth_request_module
BSD 2-Clause "Simplified" License
681 stars 202 forks source link

Fix logrotate and update rpm spec file #56

Closed alexjfisher closed 5 years ago

alexjfisher commented 5 years ago

I think the debian equivalent also needs updating, but with these changes I was able to build a 0.0.4 RPM on CentOS 7.

alexjfisher commented 5 years ago

Commit amended to now also include creation of log directory. This already happens in the debian build.

oxpa commented 5 years ago

As far as I can see, in debian we are using an init script which redirects output to a log file.

In redhat we rely on a .service file and systemd to store logs in journald (we require systemd in the spec file). I can't find where the daemon writes logs into a file. Could you point that to me?

alexjfisher commented 5 years ago

https://github.com/nginxinc/nginx-ldap-auth/blob/d9a21498253821a2fdec3aaddffca80756f63999/nginx-ldap-auth.default#L14

Sourced by https://github.com/nginxinc/nginx-ldap-auth/blob/d9a21498253821a2fdec3aaddffca80756f63999/nginx-ldap-auth.service#L10

$LOG is used in https://github.com/nginxinc/nginx-ldap-auth/blob/d9a21498253821a2fdec3aaddffca80756f63999/nginx-ldap-auth-daemon.py#L3

In /var/log/messages I had

Nov 16 06:29:47 kibana-01c nginx-ldap-auth-daemon[6058]: /usr/bin/nginx-ldap-auth-daemon: line 3: /var/log/nginx-ldap-auth/daemon.log: No such file or directory
oxpa commented 5 years ago

Could you please remove %setup modification and logs removal and I will merge your PR.