Oracle Listener failed to start with error TNS-12555, TNS-00525, TNS-12560

 As oracle user, when I tried to start the listener using lsnrctl start command, I get the below messages:

[oracle@orahow ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.3.0 – Production on 25-MAR-2017 08:24:46

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Starting /data/oracle/app/product/11.2.0.3/dbhome_1/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 11.2.0.3.0 – Production
System parameter file is /data/oracle/app/product/11.2.0.3/dbhome_1/network/admin/listener.ora
Log messages written to /data/oracle/app/product/11.2.0.3/dbhome_1/log/diag/tnslsnr/ip-172-31-21-209/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=171.31.21.209)(PORT=1521)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=extproc)))
TNS-12555: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00525: Insufficient privilege for operation
Linux Error: 1: Operation not permitted

Listener failed to start. See the error message(s) above…

Cause:

In the directory /var/tmp/.oracle there exist some socket files which do not belong to oracle user but to another user (e.g. oraapp) and another group (e.g. root).

Example:

$ ls -l /var/tmp/.oracle
srwxrwxrwx 1 oraapp oraapp 0 Mar  8 12:08 s#1947.2
srwxrwxrwx 1 oraapp oraapp 0 Mar  8 12:08 s#1947.1
srwxrwxrwx 1 oraapp oraapp 0 Mar  8 16:15 s#5200.1
srwxrwxrwx 1 oraapp oraapp 0 Mar  8 16:15 s#5200.2
srwxrwxrwx 1 oraapp oraapp 0 Mar  8 16:54 s#2021.2
srwxrwxrwx 1 oraapp oraapp 0 Mar  8 16:54 s#2021.1
srwxrwxrwx 1 oraapp oraapp 0 Mar  9 08:58 s#3348.2
srwxrwxrwx 1 oraapp oraapp 0 Mar  9 08:58 s#3348.1

When the Listener process starts, it tries to create the following socket files:

/var/tmp/.oracle/s#<pid>.1
/var/tmp/.oracle/s#<pid>.2
/var/tmp/.oracle/sREGISTER

where <pid> is the ID of the operating system process for the Listener.

As the file /var/tmp/.oracle/sREGISTER already exists and belongs to a UNIX user other than oracle, the Listener process cannot create a new socket file with that name. Therefore the Listener fails to start.

Resolution:

Delete all socket files from directory /var/tmp/.oracle as UNIX user root.

Start the Listener by executing the command “lsnrctl start” using oracle user.

[oracle@orahow]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.3.0 – Production on 25-MAR-2017 08:32:43

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Starting /data/oracle/app/product/11.2.0.3/dbhome_1/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 11.2.0.3.0 – Production
System parameter file is /data/oracle/app/product/11.2.0.3/dbhome_1/network/admin/listener.ora
Log messages written to /data/oracle/app/product/11.2.0.3/dbhome_1/log/diag/tnslsnr/ip-171-31-21-209/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.31.21.209)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=171.31.21.209)(PORT=1521)))
STATUS of the LISTENER
————————
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 – Production
Start Date                25-MAR-2017 08:32:43
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /data/oracle/app/product/11.2.0.3/dbhome_1/network/admin/listener.ora
Listener Log File         /data/oracle/app/product/11.2.0.3/dbhome_1/log/diag/tnslsnr/ip-171-31-21-209/listener/alert/log.xml
Listening Endpoints Summary…
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=171.31.21.209)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Services Summary…
Service “almnew” has 1 instance(s).
  Instance “almnew”, status UNKNOWN, has 1 handler(s) for this service…
Service “extproc” has 1 instance(s).
  Instance “extproc”, status UNKNOWN, has 1 handler(s) for this service…
The command completed successfully