EM12c: ‘java.io.IOException: Cannot run program “/usr/lib/oracle/agent/sbin/nmo”: java.io.IOException: error=2, No such file or directory’ Reported in gcagent.log

APPLIES TO:
Enterprise Manager Base Platform – Version 12.1.0.4.0 and later
Information in this document applies to any platform.

 

SYMPTOMS:
$AGENT_INST/sysman/log/gcagent.log reports the following message every 30 minutes

014-09-16 10:08:18,203 497:C6397182:GC.SysExecutor.8 (Ping OMS) INFO – attempting another heartbeat
2014-09-16 10:08:29,231 316:60A5495:GC.SysExecutor.5 (NmoHealthTask) INFO – Job Attributes: {JobID=AgentHealthMonitor:1410862109231, KeepAliveRequest=false} Job Command: {/usr/lib/oracle/agent/sbin/nmo}
2014-09-16 10:08:29,236 316:60A5495 WARN – NmoStatus: Unable to verify nmo.
oracle.sysman.gcagent.target.interaction.execution.JobExecutionMgr$AuthenticatedJobExecutionException: ERROR: NMO not setuid-root (Unix-only)
at oracle.sysman.gcagent.target.interaction.execution.JobExecutionMgr.call(JobExecutionMgr.java:1219)
at oracle.sysman.gcagent.jobs.JobRequestDriver.executeJobStep(JobRequestDriver.java:1482)
at oracle.sysman.gcagent.task.executor.TrackThreadFactory$1.run(TrackThreadFactory.java:54)
at oracle.sysman.gcagent.util.system.GCAThread$RunnableWrapper.run(GCAThread.java:189)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Cannot run program “/usr/lib/oracle/agent/sbin/nmo”: java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at oracle.sysman.gcagent.common.SafeProcessBuilder.start(SafeProcessBuilder.java:120)

 

CHANGES:
Agents are installed using the rpm method and using the: “–relocate /usr/lib/oracle/agent=/u01/app/em” option

 

CAUSE:
SBIN was set incorrectly in following files

1. /u02/agent12c/core/12.1.0.4.0/replacebins.sh
SBIN_HOME=/usr/lib/oracle/agent/sbin

2. /u02/agent12c/core/12.1.0.4.0/bin/emctl
#This is the location of setuid executables at the agent
SBINDIR=/usr/lib/oracle/agent/sbin

 

SOLUTION:
1. Stop agent

$AGENT_INST/bin/emctl stop agent

2. Backup and edit the following files

a. /u02/agent12c/core/12.1.0.4.0/replacebins.sh

OLD Entry:
———–
SBIN_HOME=/usr/lib/oracle/agent/sbin

NEW Entry:
———–
SBIN_HOME=/u02/agent12c/sbin

b. AGENT_HOME/bin/emctl

OLD Entry:
———–
#This is the location of setuid executables at the agent
SBINDIR=/usr/lib/oracle/agent/sbin

NEW Entry:
———–
SBINDIR=/u02/agent12c/sbin

Example:
——–
$ grep ‘SBIN_HOME’ /u02/agent12cr3/core/12.1.0.4.0/replacebins.sh
SBIN_HOME=/u02/agent12cr3/sbin
if [ -f ${SBIN_HOME}/$BINARY.${SBIN_SUFFIX} ]
$MVF ${SBIN_HOME}/$BINARY.${SBIN_SUFFIX} ${SBIN_HOME}/$BINARY

$ grep ‘SBIN’ /u02/agent12cr3/core/12.1.0.4.0/bin/emctl
SBINDIR=/u02/agent12cr3/sbin
export SBINDIR

3. Run AGENT_HOME/root.sh

# sh /u02/agent12c/core/12.1.0.4/root.sh

4. Start agent

$AGENT_INST/bin/emctl start agent

Recent Posts