Bug 477812

Summary: satellite Installer shows invalid option error while invoking restorecon
Product: Red Hat Satellite 5 Reporter: Pradeep Kilambi <pkilambi>
Component: InstallerAssignee: Jan Pazdziora <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Jeff Browning <jbrownin>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: bperkins, jesusr, mzazrivec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:11:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 457079    

Description Pradeep Kilambi 2008-12-23 21:36:51 UTC
Description of problem:

Installer shows invalid option while invoking restorecon


** Database: Installation complete.
** Database: Setting up database connection.
** Database: Testing database connection.
** Database: Populating database.
*** Progress: ##################################################################
* Setting up users and groups.
** GPG: Initializing GPG and importing key.
** GPG: Creating /root/.gnupg directory
* Performing initial configuration.
/sbin/restorecon: invalid option -- r
usage:  /sbin/restorecon [-Rnv] [-e excludedir ] [-o filename ] [-f filename | pathname... ]
/sbin/restorecon: invalid option -- r
usage:  /sbin/restorecon [-Rnv] [-e excludedir ] [-o filename ] [-f filename | pathname... ]
* Activating RHN Satellite.
** Loading RHN Satellite Certificate.
** Verifying certificate locally.
** Activating RHN Satellite.

Comment 1 Jan Pazdziora 2008-12-25 16:58:28 UTC
What version of 5.3.0 is this? Can you confirm that this is on RHEL 4 while you do not see the error on RHEL 5?

Comment 2 Pradeep Kilambi 2009-01-06 22:13:35 UTC
this is on latest 530 iso 

Satellite-5.3.0-RHEL4-re20081223.1-i386-embedded-oracle.iso

yep I don't see it on RHEL-5 version of iso, only RHEL-4

Comment 3 Jesus M. Rodriguez 2009-01-30 22:09:10 UTC
+ mkdir -p /rhnsat/data /rhnsat/admin
+ chown -R oracle:dba /rhnsat
+ restorecon -r /rhnsat
restorecon: invalid option -- r
usage:  restorecon [-Rnv] [-e excludedir ] [-o filename ] [-f filename | pathname... ]

ISO: Satellite-5.3.0-RHEL4-re20090130.1-i386-embedded-oracle.iso

Comment 4 Jesus M. Rodriguez 2009-01-30 22:26:10 UTC
/opt/apps/oracle/admin/10.2.0/create-db.sh is the problem:

grep restorecon create-db.sh 
/sbin/restorecon -rvi $DataDB $AdminDB

Notice the -r.

On RHEL4:
# restorecon --help
restorecon: invalid option -- -
usage:  restorecon [-Rnv] [-e excludedir ] [-o filename ] [-f filename | pathname... ]

Does not have a -r option. Which the man page defines as recursive:

-R     change files and directories file labels recursively

BUT on RHEL5, restorecon has both -R and -r mapped to do the same thing:

-R -r  change files and directories file labels recursively

Comment 5 Jesus M. Rodriguez 2009-01-30 22:27:12 UTC
Proposed fix is to fix create-db.sh to use -R instead of -r which will take care of both EL5 and EL4.  Alternatively, make the script more complicated to see if it should run restorecon at all on el4.  I'm ok with just changing the options.

Comment 6 Jan Pazdziora 2009-01-31 08:06:21 UTC
The plan is not to run restorecon (and setsebool, and friends) on RHEL 4 at all, since we won't be providing the policy there anyway. Of course, similar thing on RHEL 5 with SELinux disabled (if we are going to allow that combination at all).

I just need to find a good method of figuring out the "there is no policy provided" since I do not want to hardcode the "RHEL 4" condition.

Comment 7 Jesus M. Rodriguez 2009-01-31 22:32:36 UTC
Fixed in revision 180987 in svn. Though we still have a larger issue as per comment #6.

Comment 8 Jesus M. Rodriguez 2009-01-31 23:10:11 UTC
/var/log/rhn/install_db.log

+ set -e
+ ORAENV_ASK=NO
+ ORACLE_SID=embedded
+ export ORAENV_ASK ORACLE_SID
+ . oraenv
++ case ${ORACLE_TRACE:-""} in
++ N=
++ C=
++ echo '\c'
++ grep c
++ N=-n
++ '[' /usr/lib/oracle/10.2.0.4/client = 0 ']'
++ OLDHOME=/usr/lib/oracle/10.2.0.4/client
++ case ${ORAENV_ASK:-""} in
++ NEWSID=embedded
++ export ORACLE_SID
+++ dbhome embedded
++ ORAHOME=/opt/apps/oracle/web/product/10.2.0/db_1
++ case $? in
++ ORACLE_HOME=/opt/apps/oracle/web/product/10.2.0/db_1
++ export ORACLE_HOME
++ case "$LD_LIBRARY_PATH" in
++ LD_LIBRARY_PATH=/opt/apps/oracle/web/product/10.2.0/db_1/lib
++ export LD_LIBRARY_PATH
++ case "$OLDHOME" in
++ case "$PATH" in
+++ echo /usr/lib/oracle/10.2.0.4/client/bin:/usr/lib/oracle/10.2.0.4/client/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
+++ sed 's;/usr/lib/oracle/10.2.0.4/client/bin;/opt/apps/oracle/web/product/10.2.0/db_1/bin;g'
++ PATH=/opt/apps/oracle/web/product/10.2.0/db_1/bin:/opt/apps/oracle/web/product/10.2.0/db_1/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
++ export PATH
+++ LANG=C
+++ ulimit
++ ULIMIT=unlimited
++ '[' 0 = 0 -a unlimited '!=' unlimited ']'
+ mkdir -p /rhnsat/data /rhnsat/admin
+ chown -R oracle:dba /rhnsat
+ restorecon -r /rhnsat
restorecon: invalid option -- r
usage:  restorecon [-Rnv] [-e excludedir ] [-o filename ] [-f filename | pathname... ]

Comment 9 Jan Pazdziora 2009-02-04 13:05:27 UTC
Issue from initial comment and from comment #2 addressed in Spacewalk, commits 64c27a9b2f062cf6b27d27d509d715d2ad03c859, spacewalk-setup-0.5.7-1.

Comment 10 Jan Pazdziora 2009-02-04 13:10:00 UTC
The other issues addressed in svn, r181097, oracle-server-scripts-10.2.0-24, and in Spacewalk, commit a4c92cecc09614f5c86d70919bcb221aa331f7f5, spacewalk-setup-0.5.7-1.

Comment 11 Jan Pazdziora 2009-02-09 09:20:17 UTC
With spacewalk-setup-0.5.8-1 and oracle-server-scripts-10.2.0-24 available on Satellite-5.3.0-RHEL5-re20090206.1, moving ON_QA.

Comment 12 Jan Pazdziora 2009-02-17 07:18:56 UTC
Pulling away from ON_QA for now.

Comment 13 Jan Pazdziora 2009-02-24 12:30:43 UTC
With compose Satellite-5.3.0-RHEL5-re20090220.1 available, moving ON_QA.

Comment 14 Jeff Browning 2009-04-21 19:17:28 UTC
Verified

Comment 15 Milan Zázrivec 2009-09-02 11:24:40 UTC
Verified in stage -> RELEASE_PENDING

Comment 16 Brandon Perkins 2009-09-10 19:11:19 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html