Link to home
Create AccountLog in
Avatar of cpatte7372
cpatte7372Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Linux Script Not Executing

Hello Expert

An expert called TinTin help me run the attached script by issuing the following commands:

[root@localhost Downloads]# cat OracleSw_PreInstall.sh | tr -d "\r" > OracleSw_PreInstall.good_endings.sh
[root@localhost Downloads]#
[root@localhost Downloads]# chmod +x OracleSw_PreInstall.good_endings.sh
[root@localhost Downloads]#
[root@localhost Downloads]# sh -x OracleSw_PreInstall.good_endings.sh

After running the above commands, I got the following output:

+ PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin:/bin:/usr/bin:/usr/sbin
+ USER_ATTR=/etc/user_attr
+ PROJECT_FILE=/etc/project
+ PROJECT_FILE_BACKUP=/etc/project.bkp.3638
+ USER_ATTR_BACKUP=/etc/user_attr.bkp.3638
+ SOLARIS_SYSTEM=/etc/system
+ SOLARIS_SYSTEM_BACKUP=/etc/system.bkp.3638
+ PROJECT_DIFF=0
+ SYSTEM_BACKUP=.bkp.3638
+ BASEDIR_PERMISSIONS=755
+ RELEASE=/etc/release
+ SOLARIS_ORATAB=/var/opt/oracle/oratab
+ SOLARIS_ORATAB_BACKUP=/var/opt/oracle/oratab.bkp.3638
+ ORACLE_PROJECT=Oracle11R2
+ OLD_ORACLE_PROJECT=Oracle10R2
+ INSTALL_OPTION=
+ INSTALL_REGISTRY_DIR=/var/tmp/5620sam
+ INSTALL_REGISTRY_FILE=/var/tmp/5620sam/dbconfig.properties
+ DELIM_BEGIN='*========= 5620 SAM: Info begins ========='
+ DELIM_END='*========= 5620 SAM: Info ends ==========='
+ DELIM_BEGIN_LINUX='#========= 5620 SAM: Info begins ========='
+ DELIM_END_LINUX='#========= 5620 SAM: Info ends ==========='
+ ULIMIT_BEGIN_LINUX='#======== 5620 SAM DB user ulimit setting starts ========'
+ ULIMIT_END_LINUX='#======== 5620 SAM DB user ulimit setting ends ========'
+ TMP_FILE=/tmp/.system.3638
+ NSSWITCH_CONF=/etc/nsswitch.conf
+ TMP_NSSWITCH=/tmp/.system.3638.nsswitch
+ TMP_OSCHECKFILE=/tmp/.system.3638.oscheck
+ UNIXBOOTSEQFILE=/platform/i86pc/kernel/amd64/unix
+ AWK_CMD=/bin/awk
+ ECHO_CMD=echo
+ UNLOCK_PASSWORD='passwd -u'
++ uname
+ PLATFORM=Linux
+ NSSMODIFIED=n
+ SAMADMIN_USER=samadmin
+ modifyPassword=0
+ PKGCHK=
+ LINUX_SYSTEM=/etc/sysctl.conf
+ LINUX_SYSTEM_BACKUP=/etc/sysctl.conf.bkp.3638
+ LINUX_ORATAB=/etc/oratab
+ LINUX_ORATAB_BACKUP=/etc/oratab.bkp.3638
+ LINUX_SEC_LIMIT=/etc/security/limits.conf
+ LINUX_SEC_LIMIT_BACKUP=/etc/security/limits.conf.bkp.3638
+ LINUX_VERSION_FILE=/proc/version
+ LINUX_GRUB_CONFIG=/etc/grub.conf
+ LINUX_GRUB_CONFIG_BACKUP=/etc/grub.conf.bkp.3638
+ initLinuxVariables
+ '[' Linux = Linux ']'
+ ECHO_CMD='echo -e'
+ UNLOCK_PASSWORD='passwd -u -f'
+ '[' '!' -f /bin/awk ']'
+ '[' -f /proc/version ']'
+ /bin/grep Ubuntu /proc/version
+ '[' 1 -eq 0 ']'
++ /usr/bin/id
++ /usr/bin/cut -c1-11
+ '[' 'uid=0(root)' '!=' 'uid=0(root)' ']'
+ RUNTIME_OPTIONS=
+ '[' '' = -reconfig ']'
+ '[' Linux = Linux ']'
+ '[' '' = remove_project ']'
+ preInstallLinux
+ validateInstallOption
+ INSTALL_TYPE=3
+ echo -e '\n\nPlease select between the following option:\n'


Please select between the following option:

+ echo -e '   1) NEW INSTALL OR DB RESTORE OF 5620 SAM'
   1) NEW INSTALL OR DB RESTORE OF 5620 SAM
+ echo -e '   2) UPGRADE OF 5620 SAM'
   2) UPGRADE OF 5620 SAM
+ echo -e '   3) EXIT\n'
   3) EXIT

+ echo -e '   Please enter(1,2 or 3): \c'
   Please enter(1,2 or 3): + read INSTALL_TYPE

After selecting option 1

I get the following output:

1
+ '[' 1 = 1 ']'
+ INSTALL_OPTION=install
+ validateRHEL
+ '[' '' == '$=true' ']'
+ checkLinuxOsRequirements
+ /sbin/service iptables status
+ grep 'not running'
+ '[' 1 -ne 0 ']'
+ echo -e '\nWARNING: Firewall(iptables) is enabled, please check the planning guide\n'

WARNING: Firewall(iptables) is enabled, please check the planning guide

+ sestatus
+ grep disabled
+ '[' 1 -ne 0 ']'
+ echo -e '\nERROR: SELinux is enabled and SELinux is not supported\n'

ERROR: SELinux is enabled and SELinux is not supported

+ exit 1
[root@localhost Downloads]#

However, I should ge the following output:

For Oracle, pre-install will create or reuse user->oracle,
group->dba with homedir->/opt/5620sam/oracle11r2.
Creating dba group ...
Group addition done for dba
Oracle user [oracle] new home directory will be
[/opt/5620sam/oracle11r2].
Checking or Creating the Oracle user home directory
/opt/5620sam/oracle11r2...
Checking user oracle...
Adding oracle...
Changing ownership of the directory /opt/5620sam/oracle11r2 to
oracle:dba.
About to unlock the UNIX user [oracle]
Unlocking password for user oracle.
passwd: Success
Unlocking the UNIX user [oracle] completed

Can someone please help me figure out what I'm doing wrong?

Cheers

Carlton
OracleSw-PreInstall.sh
Avatar of Joseph Gan
Joseph Gan
Flag of Australia image

Disable SELinux, and run the script again.
ASKER CERTIFIED SOLUTION
Avatar of ckluka
ckluka

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of cpatte7372

ASKER

Cheers
I have provided the correct answer!
Avatar of ckluka
ckluka

Actually, you did not. Disabling SELinux is overkill. It's acceptable for the user's situation to set SELINUX=permissive rather than SELINUX=disabled. This way, SELinux will permit the user's script to run, while still logging any security issues for administrator review.
I have provide the answer that why Carlton could not run script. How hard to re-enable SELinux after running the script?
Because for the application he is installing, he will require an indefinite lowering of security settings.

Additionally, you did not mention *how* to do what you wanted him to do.
He was asking "what I'm doing wrong?", not "how to disable SELinux" !