Bug 501925 - `service rhn-search cleanindex` do not work
`service rhn-search cleanindex` do not work
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: New Feature (Show other bugs)
530
All Linux
medium Severity medium
: ---
: ---
Assigned To: John Matthews
Jan Hutař
:
Depends On:
Blocks: 457073
  Show dependency treegraph
 
Reported: 2009-05-21 07:02 EDT by Jan Hutař
Modified: 2009-09-10 15:32 EDT (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Jan Hutař 2009-05-21 07:02:59 EDT
Description of problem:
Getting error message when calling `service rhn-search cleanindex`.


Version-Release number of selected component (if applicable):
Satellite-5.3.0-RHEL5-re20090507.1-x86_64


How reproducible:
always


Steps to Reproduce:
1. # /etc/init.d/rhn-search cleanindex


Actual results:
Stopping rhn-search...
rhn-search was not running.
/etc/init.d/rhn-search: line 79: exec: java: not found


Expected results:
indexes cleaned
Comment 1 Jan Hutař 2009-05-21 07:03:38 EDT
# rpm -qa | grep -i java | sort
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64
java-1.6.0-ibm-1.6.0.4-1jpp.1.el5.x86_64
java-1.6.0-ibm-devel-1.6.0.4-1jpp.1.el5.x86_64
java-1.6.0-openjdk-1.6.0.0-0.25.b09.el5.x86_64
java-1.6.0-openjdk-devel-1.6.0.0-0.25.b09.el5.x86_64
spacewalk-java-0.5.44-17.el5sat.noarch
spacewalk-java-config-0.5.44-17.el5sat.noarch
spacewalk-java-lib-0.5.44-17.el5sat.noarch
Comment 2 Clifford Perry 2009-05-22 11:11:57 EDT
Most likely want to use:

/etc/alternatives/java 

as command, rather than 'java' for the 'exec java' and hope that it is correctly within the bash environment $PATH. 

removeindex() {
    SEARCH_CLASS_PATH=`build-classpath-directory /usr/share/rhn/search/lib /usr/share/java/ojdbc14.jar`
    CLASSPATH=${SEARCH_CLASS_PATH} exec java com.redhat.satellite.search.DeleteIndexes
}


Cliff

PS - John - not sure why, but maybe cleanindex should also restart search post running, my older (month old 530 Sat shows):

    'cleanindex')
        stopit
        unlock
        removeindex
        ;;
Comment 3 Jan Hutař 2009-05-25 03:56:49 EDT
I have just resolved this. This appeared on the system where I have installed & uninstalled Satellite few times and I have just noted that /etc/alternatives/java was a broken link. So this is not a $PATH issue, this was problem with a system. `alternatives --auto java` fixed the link. Sorry for a mess :-(
Comment 4 John Matthews 2009-05-26 11:03:15 EDT
Vader commit:  3a09a2120282008ade983a6075e4893f28bc8a04

Changed cleanindex to start search after clean has completed.
Comment 5 Jan Hutař 2009-06-17 07:35:52 EDT
Seems to be working correctly now on Satellite-5.3.0-RHEL5-re20090612.0-x86_64:

# service rhn-search cleanindex
Stopping rhn-search...
Stopped rhn-search.
09/06/17 13:34:50 INFO search.DeleteIndexes: Running query: deleteLastErrata
09/06/17 13:34:51 INFO search.DeleteIndexes: Attempting to delete /usr/share/rhn/search/indexes/errata
09/06/17 13:34:52 INFO search.DeleteIndexes: Running query: deleteLastPackage
09/06/17 13:34:52 INFO search.DeleteIndexes: Attempting to delete /usr/share/rhn/search/indexes/package
09/06/17 13:34:52 INFO search.DeleteIndexes: Running query: deleteLastServer
09/06/17 13:34:52 INFO search.DeleteIndexes: Attempting to delete /usr/share/rhn/search/indexes/server
09/06/17 13:34:52 INFO search.DeleteIndexes: Running query: deleteLastHardwareDevice
09/06/17 13:34:52 INFO search.DeleteIndexes: Attempting to delete /usr/share/rhn/search/indexes/hwdevice
09/06/17 13:34:52 INFO search.DeleteIndexes: Running query: deleteLastSnapshotTag
09/06/17 13:34:52 INFO search.DeleteIndexes: Running query: deleteLastServerCustomInfo
09/06/17 13:34:52 INFO search.DeleteIndexes: Index files have been deleted and database has been cleaned up, ready to reindex
Starting rhn-search...
# service rhn-search status
rhn-search is running (6381).
Comment 6 Milan Zazrivec 2009-08-20 09:15:00 EDT
5.3.0 stage testing: service rhn-search cleanindex cleans the indexes
and starts the service again -> RELEASE_PENDING
Comment 7 Brandon Perkins 2009-09-10 15:32:36 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.

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

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