Author: rmeggins
Update of /cvs/dirsec/dsmlgw/misc In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21023
Modified Files: setup-ds-dsmlgw.in Log Message: update dsmlgw.cfg and dsmlgw.env with correct information
Index: setup-ds-dsmlgw.in =================================================================== RCS file: /cvs/dirsec/dsmlgw/misc/setup-ds-dsmlgw.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- setup-ds-dsmlgw.in 23 Apr 2008 16:55:58 -0000 1.1 +++ setup-ds-dsmlgw.in 23 Apr 2008 18:28:26 -0000 1.2 @@ -55,30 +55,22 @@
# e.g. /etc/dirsrv/dsmlgw dsmlgwconfigdir="@dsmlgwconfigdir@" +dsmlgwlogdir="@dsmlgwlogdir@" +dsmlgwrundir="@dsmlgwrundir@" basecfgdir=`dirname $dsmlgwconfigdir` -# default security dir -securitydir="@securitydir@" -defaultsecdir=1 +securitydir="@dsmlgwconfigdir@"
# see if there is a $dsmlgwconfigdir/../admin-serv admservdir=$basecfgdir/admin-serv if [ -f "$admservdir/local.conf" ] ; then echo Reading parameters from Administration Server config . . . host=`getValFromLdif serverHostName "$admservdir/local.conf"` - port=`getValFromLdif configuration.nsServerPort "$admservdir/local.conf"` sec=`getValFromLdif configuration.nsServerSecurity "$admservdir/local.conf"` - if [ "$sec" = "on" ] ; then - httpurl="https://$host:$port" - if [ -n "$defaultsecdir" ] ; then - securitydir="$admservdir" - defaultsecdir= - fi - else - httpurl="http://$host:$port" + if [ "$sec" = "on" -a ! -f $securitydir/cert8.db ] ; then + cp $admservdir/cert8.db $securitydir fi dsmlgwuser=`ls -l $admservdir/local.conf | awk '{print $3}'` dsmlgwgroup=`ls -l $admservdir/local.conf | awk '{print $4}'` - echo Using Administration Server URL $httpurl . . . else echo echo '########################################################################' @@ -102,20 +94,13 @@ if [ "$sec" = "on" ] ; then port=`getValFromLdif nsslapd-secureport "$dir/dse.ldif"` ldapurl="ldaps://$host:$port" - if [ -n "$defaultsecdir" ] ; then - securitydir="$dir" - defaultsecdir= + if [ ! -f $securitydir/cert8.db ] ; then + cp $dir/cert8.db $securitydir fi else port=`getValFromLdif nsslapd-port "$dir/dse.ldif"` ldapurl="ldap://$host:$port" fi - # get suffix - first non-netscaperoot suffix - savesuffix="$suffix" - suffix=`grep ^nsslapd-suffix: $dir/dse.ldif | sed -e 's/^nsslapd-suffix:[ ]*//' | grep -v -i o=netscaperoot | head -1` - if [ -z "$suffix" ] ; then - suffix="$savesuffix" - fi if [ -z "$dsmlgwuser" ] ; then dsmlgwuser=`ls -l $dir/dse.ldif | awk '{print $3}'` fi @@ -126,7 +111,7 @@ done
if [ -n "$ldapurl" ] ; then - echo Using Directory Server URL $ldapurl/$suffix . . . + echo Using Directory Server URL $ldapurl fi
# get command line arguments @@ -188,10 +173,7 @@ if [ -f "$inffile" ] ; then hostname=`getValFromInf FullMachineName $inffile` port=`getValFromInf ServerPort $inffile` - suffix=`getValFromInf Suffix $inffile` dirmgr=`getValFromInf RootDN $inffile` - httpport=`getValFromInf Port $inffile` - httpurl="http://$host:$httpport" ldapurl="ldap://$host:$port" infuser=`getValFromInf SysUser $inffile` infgroup=`getValFromInf SysGroup $inffile` @@ -208,8 +190,7 @@ dsmlgwgroup="$infgroup" fi echo Using parameters from file $inffile . . . - echo Using Administration Server URL $httpurl . . . - echo Using Directory Server URL $ldapurl/$suffix . . . + echo Using Directory Server URL $ldapurl . . . fi
if [ -z "$reconfig" -a -f $dsmlgwconfigdir/dsmlgw.cfg ] ; then @@ -225,19 +206,21 @@
echo Generating config file $dsmlgwconfigdir/dsmlgw.cfg . . . # generate dsmlgw.cfg in the $dsmlgwconfigdir directory -rm -f $dsmlgwconfigdir/dsmlgw.conf -sed -e "s#@host@#$hostname#g" \ - -e "s#@port@#$port#g" \ - -e "s#@httpport@#$httpport#g" \ - -e "s#@suffix@#$suffix#g" \ - -e "s#@dirmgr@#$dirmgr#g" \ - -e "s#^securitypath.*$#securitypath $securitydir#g" \ - -e "s#@ldapurl@#$ldapurl#g" \ - -e "s#@httpurl@#$httpurl#g" \ - @configdir@/dsmlgw.tmpl > $dsmlgwconfigdir/dsmlgw.conf +rm -f $dsmlgwconfigdir/dsmlgw.cfg +echo ServerHost=$host > $dsmlgwconfigdir/dsmlgw.cfg +echo ServerPort=$port >> $dsmlgwconfigdir/dsmlgw.cfg +echo BindDN=$rootdn >> $dsmlgwconfigdir/dsmlgw.cfg +echo BindPW= >> $dsmlgwconfigdir/dsmlgw.cfg + +echo Updating the user information in $dsmlgwconfigdir/dsmlgw.env . . . +cp $dsmlgwconfigdir/dsmlgw.env $dsmlgwconfigdir/dsmlgw.env.orig +sed -e "s/TOMCAT_USER=.*/TOMCAT_USER=$dsmlgwuser/" $dsmlgwconfigdir/dsmlgw.env.orig > $dsmlgwconfigdir/dsmlgw.env + +chown -R $dsmlgwuser:$dsmlgwgroup $dsmlgwconfigdir +chown -R $dsmlgwuser:$dsmlgwgroup $dsmlgwlogdir +chown -R $dsmlgwuser:$dsmlgwgroup $dsmlgwrundir
-chown $dsmlgwuser:$dsmlgwgroup $dsmlgwconfigdir/dsmlgw.conf -chmod 0400 $dsmlgwconfigdir/dsmlgw.conf +chmod 0400 $dsmlgwconfigdir/dsmlgw.cfg
echo echo The DSML Gateway has been successfully configured.
389-commits@lists.fedoraproject.org