nginxinc / nginx-ldap-auth

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

misleading error message if log directory is not accessible #36

Closed lesinigo closed 6 years ago

lesinigo commented 6 years ago

Setting the $LOG variable to a file in a non-existent directory will result in a message telling me that the non-existent log file does not exist:

# rm -rf /var/log/nginx-ldap-auth
# LOG=/var/log/nginx-ldap-auth/daemon.log /usr/bin/nginx-ldap-auth-daemon
/usr/bin/nginx-ldap-auth-daemon: line 2: /var/log/nginx-ldap-auth/daemon.log: No such file or directory

The shell code should possibly try to create the directory and/or emit a more explicit message that warns the user that the log directory cannot be accessed.

(IMHO: better yet to get rid of the /bin/sh stuff and directly use #!/usr/bin/env python2 as per PEP-0394)

vl-homutov commented 6 years ago

The error message is very clear, and complains exactly about the root cause: missing file or directory. Various packaging scripts will be fixed to deal correctly with directories they use (i.e. create when needed or have it in dependencies or whatever fix is appropriate).