When doing Apache graceful restart, Web Agent reports error "PID Cache error"
search cancel

When doing Apache graceful restart, Web Agent reports error "PID Cache error"

book

Article ID: 7127

calendar_today

Updated On:

Products

CA Single Sign On Secure Proxy Server (SiteMinder) CA Single Sign On SOA Security Manager (SiteMinder) CA Single Sign-On

Issue/Introduction

 

We're running a Web Agent on Apache, and when we restart Apache server
with the command :

service reload myinstance 

then the Web Agent reports errors : 

error.log : 

  May 23 14:19:36 myhost [23/May/2017:14:19:36] [Info] [CA WebAgent IPC] 
[31025] [CSmSem::getSem] Attempted to attach to non-existent semaphore with key 0xXXXXXX
  May 23 14:19:36 myhost [23/May/2017:14:19:36] [Info] [CA WebAgent IPC] 
[31025] [CSmSem::getSem] Attempted to attach to non-existent semaphore with key 0xXXXXXX
  May 23 14:19:36 myhost [23/May/2017:14:19:36] [Info] [CA WebAgent IPC] 
[31025] [CSmSem::getSem] Created semaphore 30081042 using key 0xXXXXXX
  May 23 14:19:36 myhost [23/May/2017:14:19:36] [Error] [CA WebAgent IPC] 
[31025] [CSmSharedSegment::smalloc] Error allocating shared memory segment using key 0xXXXXXX -
  File exists (17) 
  May 23 14:19:36 myhost [23/May/2017:14:19:36] [Info] [CA WebAgent IPC] 
  [31025] [CSmSem::SemRm] Removed semaphore 30081042 
  May 23 14:19:36 myhost [23/May/2017:14:19:36] [Error] SiteMinder Agent 
  May 23 14:19:36 myhost PID Cache error. 
  May 23 14:19:36 myhost Failed to initialize PID Cache 
May 23 14:19:40 myhost nm: '/{webserver_home}/bin/httpd': No such file
  May 23 14:19:40 myhost [Tue May 23 14:19:40 2017] [warn] Siteminder Web Agent: 
  restart not supported. 

Why do we have the Notice "nm: '/{webserver_home}/bin/httpd': No such file"
and Warning "Siteminder Web Agent: restart not supported." ?

 

Environment

 

  Web Agent 12.52SP1CR10 build 2813 on Apache 2.4.43 64bit RedHat 7.8;

 

Cause

 

When you ran nm -A against /usr/sbin/httpd and /usr/sbin/httpd.worker
on the RedHat Apache and you get the message :

  "no symols".

To illustrate it :

  [root@localhost /opt]# nm -A /{webserver_home}/bin/httpd
nm: /{webserver_home}/bin/httpd: no symbols

[root@localhost /opt]# nm -A /{webserver_home}/bin/httpd.worker
nm: /{webserver_home}/bin/httpd.worker: no symbols

For the Agent to be able to support graceful restart, symbols should
be available. If no symbol is available, then you'll see the message 

  "nm: '/{webserver_home}/bin/httpd': No such file"

If symbols are available from the httpd binary, but the symbol
"restart_pending" is not found, then the warning message

  "Siteminder Web Agent: restart not supported"

will appear. Out of the box Web Agent does this check for start, stop,
restart and gracefull options for the apachectl commands.

 

Resolution

 

Compile your own Apache or get an Apache version which binaries will
show symbols and the "restart_pending" symbols, in order to have the
LLAWP to not shutdown if a restart or graceful is option is send to
the apachectl command. If restart_pending symbol is not present, the
LLAWP process will shutdown and start over.

The commands

  nm -A /{webserver_home}/bin/httpd 
nm -A /{webserver_home}/bin/httpd .worker

should return symbols and "restart_pending" one.

Note that this applies up to Apache 2.4.27 Version. For higher Apache
version please refer to the following KD :

  WebAgent does not support restart with Apache 2.4
  https://knowledge.broadcom.com/external/article?articleId=205981