# Common configuration code for server and master server

BINDIR=@bindir_reloc@
RCDDIR=${PROGDIR}
export BINDIR

#set configuration directory
CONFIG=@aa_sysconfdir_reloc@

# set defaults
VARDIR=@aa_localstatedir_reloc@

# load configuration file
CONFIGFILE=${CONFIG}/rc.config
[ -r ${CONFIGFILE} ] || { echo "Configuration file ${CONFIGFILE} not found."; exit -1; }
. ${CONFIGFILE}

# set PID and LOG directories if they were not set
[ -z "${PIDDIR}" ] && PIDDIR=${VARDIR}/run
[ -z "${LOGDIR}" ] && LOGDIR=${VARDIR}/log

# test if user exists
[ X"${user}" = X"${USER}" ] || su "${user}" -c "echo" > /dev/null 2>&1 || { echo "@progtitle@ configuration problem: User ${user} does not exist or cannot be su'd to."; exit 1; }
