osstech-jp / nginx-mod-am

OpenAM Policy Agent for NGINX
16 stars 11 forks source link

Fails on CentOS 6.7 #4

Closed davison closed 8 years ago

davison commented 8 years ago

I tried the pre-built CentOS6 binary, and also tried building from source. Both gave exactly the same results which is that the plugin fails to load correctly (I assume). It never contacts the naming service on the target OpenAM server - checked with tcpdump - and despite a high log level being set, it never even gets as far as creating the logfile so it seems to fail at a VERY early stage in the plugin operation.

Output from the server (with daemon off;) looks like this:

2015/11/19 18:39:20 [notice] 26235#0: using the "epoll" event method
2015/11/19 18:39:20 [notice] 26235#0: nginx/1.7.7
2015/11/19 18:39:20 [notice] 26235#0: built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) 
2015/11/19 18:39:20 [notice] 26235#0: OS: Linux 2.6.32-573.7.1.el6.x86_64
2015/11/19 18:39:20 [notice] 26235#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2015/11/19 18:39:20 [notice] 26235#0: start worker processes
2015/11/19 18:39:20 [notice] 26235#0: start worker process 26236
2015/11/19 18:39:20 [info] 26236#0: ngx_http_am_init_process()
2015/11/19 18:39:20 [info] 26236#0: version: 4.0.0-SNAPSHOT, date: Nov  4 2014 01:31:12
2015/11/19 18:39:20 [error] 26236#0: am_web_init error status=AM_FAILURE(1)

2015/11/19 18:39:25 [debug] 26236#0: *1 ngx_http_am_handler()
2015/11/19 18:39:25 [notice] 26235#0: signal 17 (SIGCHLD) received
2015/11/19 18:39:25 [alert] 26235#0: worker process 26236 exited on signal 11
2015/11/19 18:39:25 [notice] 26235#0: start worker process 26241
2015/11/19 18:39:25 [info] 26241#0: ngx_http_am_init_process()
2015/11/19 18:39:25 [info] 26241#0: version: 4.0.0-SNAPSHOT, date: Nov  4 2014 01:31:12
2015/11/19 18:39:25 [error] 26241#0: am_web_init error status=AM_FAILURE(1)
2015/11/19 18:39:25 [debug] 26241#0: *2 ngx_http_am_handler()
2015/11/19 18:39:25 [notice] 26235#0: signal 17 (SIGCHLD) received
2015/11/19 18:39:25 [alert] 26235#0: worker process 26241 exited on signal 11
2015/11/19 18:39:25 [notice] 26235#0: start worker process 26242
2015/11/19 18:39:25 [info] 26242#0: ngx_http_am_init_process()
2015/11/19 18:39:25 [info] 26242#0: version: 4.0.0-SNAPSHOT, date: Nov  4 2014 01:31:12
2015/11/19 18:39:25 [error] 26242#0: am_web_init error status=AM_FAILURE(1)
2015/11/19 18:39:25 [debug] 26242#0: *3 ngx_http_am_handler()
2015/11/19 18:39:25 [notice] 26235#0: signal 17 (SIGCHLD) received
2015/11/19 18:39:25 [alert] 26235#0: worker process 26242 exited on signal 11
2015/11/19 18:39:25 [notice] 26235#0: start worker process 26243
2015/11/19 18:39:25 [info] 26243#0: ngx_http_am_init_process()
2015/11/19 18:39:25 [info] 26243#0: version: 4.0.0-SNAPSHOT, date: Nov  4 2014 01:31:12
2015/11/19 18:39:25 [error] 26243#0: am_web_init error status=AM_FAILURE(1)
^C
2015/11/19 18:39:35 [notice] 26243#0: signal 2 (SIGINT) received, exiting
2015/11/19 18:39:35 [notice] 26235#0: signal 2 (SIGINT) received, exiting
2015/11/19 18:39:35 [info] 26243#0: epoll_wait() failed (4: Interrupted system call)
2015/11/19 18:39:35 [notice] 26243#0: exiting
2015/11/19 18:39:35 [notice] 26243#0: exit
2015/11/19 18:39:35 [notice] 26235#0: signal 17 (SIGCHLD) received
2015/11/19 18:39:35 [notice] 26235#0: worker process 26243 exited with code 0
2015/11/19 18:39:35 [notice] 26235#0: exit

In the above output, the line break has been added after server startup, the following output is the result of a single request being made to the server.

$ uname -a
Linux tst-sbe-003 2.6.32-573.7.1.el6.x86_64 #1 SMP Tue Sep 22 22:00:00 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ yum info glibc|grep Version
Version     : 2.12
hamano commented 8 years ago

It seems am_web_init() is failing. You need to check logs/amAgent Thank you.

davison commented 8 years ago

yes, as I mentioned, that log file never gets created. Its location is defined correctly in the config file, and the permissions on the file system are correct, but the file is not created so I can't trouble shoot this any further. I think the plugin fails before it even gets that far.

davison commented 8 years ago

hmm.. if I run the nginx as root it works :) Not sure why this is needed, it's binding a high port to listen on and is running in a working directory where all the dir/file permissions look correct for unpriviliged use. Even running the server under strace didn't provide any indication as to what the requirement for a root user was.

hamano commented 8 years ago

i don't understand your permission issue... It might to related to ACL permission? Any way, you can out put debug log by edit conf/OpenSSOAgentBootstrap.properties com.sun.identity.agents.config.debug.level = /tmp/amAgent