Bug 477812 - satellite Installer shows invalid option error while invoking restorecon
satellite Installer shows invalid option error while invoking restorecon
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Installer (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Jan Pazdziora
Jeff Browning
Depends On:
Blocks: 457079
  Show dependency treegraph
Reported: 2008-12-23 16:36 EST by Pradeep Kilambi
Modified: 2009-09-10 15:11 EDT (History)
3 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-10 15:11:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Pradeep Kilambi 2008-12-23 16:36:51 EST
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 11:58:28 EST
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 17:13:35 EST
this is on latest 530 iso 


yep I don't see it on RHEL-5 version of iso, only RHEL-4
Comment 3 Jesus M. Rodriguez 2009-01-30 17:09:10 EST
+ 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 17:26:10 EST
/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.

# 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 17:27:12 EST
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 03:06:21 EST
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 17:32:36 EST
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 18:10:11 EST

+ set -e
+ ORACLE_SID=embedded
+ . oraenv
++ case ${ORACLE_TRACE:-""} in
++ N=
++ C=
++ echo '\c'
++ grep c
++ N=-n
++ '[' /usr/lib/oracle/ = 0 ']'
++ OLDHOME=/usr/lib/oracle/
++ 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
++ case "$OLDHOME" in
++ case "$PATH" in
+++ echo /usr/lib/oracle/
+++ sed 's;/usr/lib/oracle/;/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 08:05:27 EST
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 08:10:00 EST
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 04:20:17 EST
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 02:18:56 EST
Pulling away from ON_QA for now.
Comment 13 Jan Pazdziora 2009-02-24 07:30:43 EST
With compose Satellite-5.3.0-RHEL5-re20090220.1 available, moving ON_QA.
Comment 14 Jeff Browning 2009-04-21 15:17:28 EDT
Comment 15 Milan Zázrivec 2009-09-02 07:24:40 EDT
Verified in stage -> RELEASE_PENDING
Comment 16 Brandon Perkins 2009-09-10 15:11:19 EDT
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.


Note You need to log in before you can comment on or make changes to this bug.