Changeset 861


Ignore:
Timestamp:
05/15/13 15:10:59 (11 years ago)
Author:
olahaye
Message:

[jobmonarch.spec.in] postinstall fixes (avoid post to fail if condrestart
does nothing (service not started). Typo fix in sed when setting possword in config files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/pkg/rpm/jobmonarch.spec.in

    r856 r861  
    129129# $1 = 1 => install ($1 = 2 => upgrade)
    130130if [ "$1" = 1 ]; then
     131    echo "Generating random password and updating apropriate files"
    131132    # Generate a 8 char password for the database:
    132133    export DB_PASSWD=$(tr -dc A-Za-z0-9_< /dev/urandom |head -c 8 | xargs)
    133134    # Set the password in the SQL script
    134     sed -i -e '/^.*modify me:.*$/d' -e 's/^#CREATE/CREATE/g' -e "s/'';/'$DB_PASSWD';/g" %{_datadir}/jobarchived/job_dbase.sql
     135    sed -i -e '/^.*modify me:.*$/d' -e 's/^-- CREATE/CREATE/g' -e "s/'';/'$DB_PASSWD';/g" %{_datadir}/jobarchived/job_dbase.sql
    135136    # Set the password in the jobarchived config.
    136     sed -i -s "s/^#JOB_SQL_PASSWORD.*$/JOB_SQL_PASSWORD\t\t: $DB_PASSWD/g" %{_sysconfdir}/jobarchived.conf
     137    sed -i -e "s/^#JOB_SQL_PASSWORD.*$/JOB_SQL_PASSWORD\t\t: $DB_PASSWD/g" %{_sysconfdir}/jobarchived.conf
    137138    # Set the password in the ganglia conf.php
    138139    sed -i -e "s|^//\$JOB_ARCHIVE_SQL_PASSWORD.*|\$JOB_ARCHIVE_SQL_PASSWORD = \"$DB_PASSWD\"|g" %{gangliaaddonsdir}/job_monarch/conf.php
     
    140141    /sbin/chkconfig --add jobarchived
    141142elif [ "$1" = 2 ]; then
     143    echo "Restarting jobarchived if needed..."
    142144    /sbin/service jobarchived condrestart
     145    exit 0
    143146fi
    144147
Note: See TracChangeset for help on using the changeset viewer.