Automatic Start GC Agent 10.2.0.5 via gcstartup Script fails with sudo_789363.1

rongshiyuan發表於2014-09-03

Automatically Starting the Grid Control Agent 10.2.0.5 via "gcstartup" Script fails with /usr/local/bin/sudo No such file or directory (Doc ID 789363.1)


In this Document

Symptoms
Changes
Cause
Solution
References

Applies to:

Enterprise Manager Base Platform - Version 10.2.0.5 to 10.2.0.5 [Release 10.2]
Information in this document applies to any platform.
***Checked for relevance on 05-Jul-2013***

Symptoms

The Grid Control gcstartup script fails to start the Agent or the OMS after the patchset 10.2.0.5.0 has been applied to the OMS or Agent ORACLE_HOME.

During the startup of a Linux machine the following error is seen in the /var/log/boot.log

Mar 11 13:12:24 linux.oracle.com gcstartup:
..
..
..

Mar 11 13:14:29 linux.oracle.com gcstartup: /home/oracle/OracleHomes/agent10g/install/unix/scripts/agentstup: line 19: [: =: unary operator expected
Mar 11 13:14:29 linux.oracle.com gcstartup: /home/oracle/OracleHomes/agent10g/install/unix/scripts/agentstup: line 22: /usr/local/bin/sudo: No such file or directory
Mar 11 13:14:29 linux.oracle.com gcstartup: /home/oracle/OracleHomes/agent10g/install/unix/scripts/agentstup: line 19: [: =: unary operator expected
Mar 11 13:14:29 linux.oracle.com gcstartup: /home/oracle/OracleHomes/agent10g/install/unix/scripts/agentstup: line 22: /usr/local/bin/sudo: No such file or directory
Mar 11 13:14:29 linux.oracle.com rc: Starting gcstartup:  failed


Changes

10.2.0.5.0 Patchset applied to the Grid Control OMS and/or Grid Control Agent ORACLE_HOME.

Cause

This problem is logged in the internal bug "GCSTARTUP FAILS ON LINUX 10.2.0.5.0 - AGENTSTUP HAS ERRORS"

Content of the file AGENT $ORACLE_HOME/install/unix/scripts/agentstup
has the following -

#!/bin/sh
#Script to start and stop the Agent during shutdown and restart of the machine

export ORACLE_HOME=/home/oracle/OracleHomes/agent10g
installUser=oracle
executingUser=$USER
SU=/usr/local/bin/sudo

case "$1" in
start)
#Commenting as is not required after the bug 5329412
#OH=`$ORACLE_HOME/bin/emctl getemhome | grep EMHOME | cut -c8-`
#agentTZ=`grep agentTZRegion $OH/sysman/config/emd.properties | cut -c15-`
#grep $agentTZ $ORACLE_HOME/sysman/admin/ossupportedtzs.lst
#if [ $? = 0 ]; then
#TZ=$agentTZ
#export TZ
#fi
if [ $executingUser = $installUser ] ; then
$ORACLE_HOME/bin/emctl start agent
else
$SU -u $installUser $ORACLE_HOME/bin/emctl start agent
fi
;;
stop)
if [ $executingUser = $installUser ] ; then
$ORACLE_HOME/bin/emctl stop agent
else
$SU -u $installUser $ORACLE_HOME/bin/emctl stop agent
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac

 

Line 19 =
if [ $executingUser = $installUser ] ; then
Line 22 =
$SU -u $installUser $ORACLE_HOME/bin/emctl stop agent



1 - Line 19 and 26 should have quotes around $executingUser and $installUser
2 - Line 22 refers so $SU which refers to Line 7: SU=/usr/local/bin/sudo

However sudo does not exist in /usr/local/bin/ on Linux

Solution

To successfully start the Grid Control Agent via the script $ORACLE_HOME/install/unix/scripts/gcstartup, please follow the steps below.

1. cd AGENT $ORACLE_HOME/install/unix/scripts
2. cp agentstup agentstup.old
3. vi agentstup
4. Change line 7 to -

SU=/usr/bin/sudo


5. Change line 19 and 26 to -

if [ "$executingUser" = "$installUser" ] ; then



NB: If the same error is seen for OMS $ORACLE_HOME/install/unix/scripts/omsstup
i.e.
Mar 11 13:14:29 linux.oracle.com gcstartup: /home/oracle/OracleHomes/oms10g/install/unix/scripts/omsstup: line 11: [: =: unary operator expected
The same workaround applies - change -
if [ $executingUser = $installUser ] ; then
to
if [ "$executingUser" = "$installUser" ] ; then

References


 

Document Details

 
Email link to this documentOpen document in new windowPrintable Page
Type:
Status:
Last Major Update:
Last Update:
PROBLEM
PUBLISHED
7/6/2013
7/6/2013
     
 

Related Products

 
Enterprise Manager Base Platform
     
 

Document References

 
No References available for this document.
     

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1262804/,如需轉載,請註明出處,否則將追究法律責任。

相關文章