nginxinc / nginx-ldap-auth

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

Edited path in init script for daemon #1

Closed karishay closed 9 years ago

karishay commented 9 years ago

Init script requires full path

vl-homutov commented 9 years ago

On Wed, May 27, 2015 at 02:13:40PM -0700, Shannon Burns wrote:

Init script requires full path You can view, comment on, or merge this pull request online at:

https://github.com/nginxinc/nginx-ldap-auth/pull/1

diff --git a/nginx-ldap-auth-daemon-ctl.sh b/nginx-ldap-auth-daemon-ctl.sh index 4f82b00..a44526f 100755 --- a/nginx-ldap-auth-daemon-ctl.sh +++ b/nginx-ldap-auth-daemon-ctl.sh @@ -1,7 +1,7 @@

!/bin/sh

-CMD=./nginx-ldap-auth-daemon.py -PIDFILE=./nginx-ldap-auth-daemon.pid +CMD=pwd/nginx-ldap-auth-daemon.py +PIDFILE=pwd/nginx-ldap-auth-daemon.pid

case $1 in "start")

Hello,

Why do you think we need absolute paths here? The script is intended to run from the same directory where others.

We are not going to package this as init script, as in this case we have to know paths where we have installed other scripts (i.e. /usr/bin/blah)

adding pwd does not allow to run this script from any directory, it just adds current directory name, what is meaningless, because current directory already have name, it is always '.' (dot).

LinuxJedi commented 9 years ago

because start-stop-daemon is not aware of the cwd in Ubuntu. A potentially better fix would be

CMD=$PWD/nginx-ldap-auth-daemon.py but Shannon's version works too

karishay commented 9 years ago

If @LinuxJedi 's approach is preferable, I'm happy to change it.

vl-homutov commented 9 years ago

On Tue, Jun 02, 2015 at 09:29:41AM -0700, Shannon Burns wrote:

If @LinuxJedi 's approach is preferable, I'm happy to change it.

I've commited slightly modified version that should work ok on ubuntu.