Changeset 861 for branches/1.0/pkg/rpm
- Timestamp:
- 05/15/13 15:10:59 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/pkg/rpm/jobmonarch.spec.in
r856 r861 129 129 # $1 = 1 => install ($1 = 2 => upgrade) 130 130 if [ "$1" = 1 ]; then 131 echo "Generating random password and updating apropriate files" 131 132 # Generate a 8 char password for the database: 132 133 export DB_PASSWD=$(tr -dc A-Za-z0-9_< /dev/urandom |head -c 8 | xargs) 133 134 # 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.sql135 sed -i -e '/^.*modify me:.*$/d' -e 's/^-- CREATE/CREATE/g' -e "s/'';/'$DB_PASSWD';/g" %{_datadir}/jobarchived/job_dbase.sql 135 136 # 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.conf137 sed -i -e "s/^#JOB_SQL_PASSWORD.*$/JOB_SQL_PASSWORD\t\t: $DB_PASSWD/g" %{_sysconfdir}/jobarchived.conf 137 138 # Set the password in the ganglia conf.php 138 139 sed -i -e "s|^//\$JOB_ARCHIVE_SQL_PASSWORD.*|\$JOB_ARCHIVE_SQL_PASSWORD = \"$DB_PASSWD\"|g" %{gangliaaddonsdir}/job_monarch/conf.php … … 140 141 /sbin/chkconfig --add jobarchived 141 142 elif [ "$1" = 2 ]; then 143 echo "Restarting jobarchived if needed..." 142 144 /sbin/service jobarchived condrestart 145 exit 0 143 146 fi 144 147
Note: See TracChangeset
for help on using the changeset viewer.