From 7a4042b1de4c31969a3f937c82b0739b7d52e903 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 16 Jul 2012 11:36:59 -0400 Subject: [PATCH] use sfa-config instead of plc-config --- init.d/sfa | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/init.d/sfa b/init.d/sfa index 136e47c2..5e2c9c2d 100755 --- a/init.d/sfa +++ b/init.d/sfa @@ -17,17 +17,15 @@ postgresql_conf=$PGDATA/postgresql.conf pghba_conf=$PGDATA/pg_hba.conf postgresql_sysconfig=/etc/sysconfig/pgsql -# PLC consolidated (merged) config file -plc_whole_config=/etc/planetlab/plc_config.xml # SFA consolidated (merged) config file -sfa_whole_config=/etc/sfa/sfa_config.xml +sfa_whole_config=/etc/sfa/sfa_config # SFA default config (read-only template) sfa_default_config=/etc/sfa/default_config.xml # SFA local (site-dependent) file -sfa_local_config=/etc/sfa/configs/site.xml +sfa_local_config=/etc/sfa/configs/site # Source sfa shell config if present -[ -f /etc/sfa/sfa_config ] && . /etc/sfa/sfa_config +[ -f /etc/sfa/sfa_config.sh ] && . /etc/sfa/sfa_config.sh # Export so that we do not have to specify -p to psql invocations export PGPORT=$SFA_DB_PORT @@ -82,8 +80,8 @@ function reload () { files=( $sfa_default_config $sfa_local_config ) for file in "${files[@]}" ; do if [ -n "$force" -o $file -nt $sfa_whole_config ] ; then - tmp=$(mktemp /tmp/sfa_config.xml.XXXXXX) - plc-config --xml "${files[@]}" >$tmp + tmp=$(mktemp /tmp/sfa_config.XXXXXX) + sfa-config --python "${files[@]}" >$tmp if [ $? -eq 0 ] ; then mv $tmp $sfa_whole_config chmod 444 $sfa_whole_config @@ -97,10 +95,10 @@ function reload () { # Convert configuration to various formats if [ -n "$force" -o $sfa_whole_config -nt /etc/sfa/sfa_config ] ; then - plc-config --shell $sfa_whole_config > /etc/sfa/sfa_config + sfa-config --python $sfa_whole_config > /etc/sfa/sfa_config fi - if [ -n "$force" -o $sfa_whole_config -nt /etc/sfa/sfa_config.py ] ; then - plc-config --python $sfa_whole_config > /etc/sfa/sfa_config.py + if [ -n "$force" -o $sfa_whole_config -nt /etc/sfa/sfa_config.sh ] ; then + sfa-config --shell $sfa_whole_config > /etc/sfa/sfa_config.sh fi # if [ -n "$force" -o $sfa_whole_config -nt /etc/sfa/php/sfa_config.php ] ; then # mkdir -p /etc/sfa/php @@ -115,7 +113,7 @@ function reload () { #gen-sfa-cm-config.py # reload the shell version - [ -f /etc/sfa/sfa_config ] && . /etc/sfa/sfa_config + [ -f /etc/sfa/sfa_config.sh ] && . /etc/sfa/sfa_config.sh } @@ -190,7 +188,7 @@ function db_start () { ######## compute a password if needed if [ -z "$SFA_DB_PASSWORD" ] ; then SFA_DB_PASSWORD=$(uuidgen) - plc-config --category=sfa_db --variable=password --value="$SFA_DB_PASSWORD" --save=$sfa_local_config $sfa_local_config >& /dev/null + sfa-config --category=sfa_db --variable=password --value="$SFA_DB_PASSWORD" --save=$sfa_local_config $sfa_local_config >& /dev/null reload force fi @@ -202,8 +200,8 @@ function db_start () { PLC_DB_USER=$(plc-config --category=plc_db --variable=user) PLC_DB_PASSWORD=$(plc-config --category=plc_db --variable=password) # store this as the SFA user/password - plc-config --category=sfa_db --variable=user --value=$PLC_DB_USER --save=$sfa_local_config $sfa_local_config >& /dev/null - plc-config --category=sfa_db --variable=password --value=$PLC_DB_PASSWORD --save=$sfa_local_config $sfa_local_config >& /dev/null + sfa-config --category=sfa_db --variable=user --value=$PLC_DB_USER --save=$sfa_local_config $sfa_local_config >& /dev/null + sfa-config --category=sfa_db --variable=password --value=$PLC_DB_PASSWORD --save=$sfa_local_config $sfa_local_config >& /dev/null reload force fi -- 2.47.0