#!/bin/ksh93 SDIR=$( cd ${ dirname $0; }; printf "$PWD" ) MAC_PREFIX=0:0:2 ZNMASK='/24' . $SDIR/etc/zinstall_helper.kshlib || exit 1 # the glassfish archive to install. Download via # http://dlc.sun.com.edgesuite.net/glassfish/3.1.2/promoted/ GF_VER=3.1.2 GLASSFISH=/net/software/downloads/sun/GF-ESv${GF_VER}/glassfish-${GF_VER}-web-b21-unix-ml.sh # where we find the LNFctags package PKGDIR=/net/software/lnf/i386/${ uname -r; } # ZFS to inherit to the zone as pool1 DATAPOOL[pool1]=( pool=${GZPOOL}/${ZNAME}/pool1 z_pool=pool1 zopts='compression=on atime=off' ) # where to put opengrok data like checked out sources, generated xrefs, configs DATADIR[opengrok]=( z_pool=pool1/data/opengrok mode=0755 uid=${ADMINUID} gid=${ADMINGID} ) # where to put the glassfish domain setup data DATADIR[glassfish]=( z_pool=rpool/data/glassfish mode=0755 uid=webservd gid=webservd ) # where to put the DB data DATADIR[javadb]=( z_pool=rpool/data/javadb mode=0755 uid=noaccess gid=noaccess ) checkNIC checkIP checkDatadirs checkZonePathes createTempdir prepareManifest addPkg install //lnf/primary-admin # wanna use jdk-7, however, jdk-6 is still sufficient as well # actually if we would deploy precompiled web apps, only, jre-7 would be # sufficient and save us ~60MB space on a compression enabled ZFS addPkg install /developer/java/jdk-7 # glassfish contains javadb already - so avoid redundancy #addPkg install /library/java/javadb # revision control systems supported by opengrok addPkg install /developer/versioning/cvs \ /developer/versioning/git \ /developer/versioning/mercurial \ /developer/versioning/sccs \ /developer/versioning/subversion \ /library/python-2/subversion \ # don't remove since required by jre rmPkg uninstall /system/library/c++-runtime # etags is required, however, solaris does not provide such a package but # building third party packages using IPS is completely senseless, since this # crap doesn't support package relocation, like the previously SysV package # system did. So we continue to use the old pkg format and install it later. prepareProfiles createZoneConfig installZone # add java db service mkdir ${ZPATH}/root/lib/svc/manifest/application/glassfish DIR=${DATADIR[javadb].z_pool#pool1} gsed -e "/ashome/ s,/opt/glassfish,/opt/glassfish/v${GF_VER}," \ -e "/datadir/ s,/var/lib/javadb/data,${DIR}," \ ${SDIR}/files/gf_javadb.xml \ >${ZPATH}/root/lib/svc/manifest/application/glassfish/javadb.xml cp ${SDIR}/files/gf_javadb.method $ZPATH/root/lib/svc/method/glassfish-javadb chmod 755 ${ZPATH}/root/lib/svc/method/glassfish-javadb bootZone checkDatadirsPost # available via http://dev.cs.uni-magdeburg.de/lnf/i386/5.11/ print "y\n" | pkgadd -R ${ZPATH}/root -d ${PKGDIR} LNFctags customizeRunningZone # copy glassfish helper stuff ( cd ${SDIR}/files/glassfish && \ pax -rwLlk -o gid=admin -o uid=staff . ${ZPATH}/root/local/home/admin/ ) gsed -i -e "/^GF_VERSION=/ s,=*,=v${GF_VER}," \ ${ZPATH}/root/local/home/admin/gf.properties* find ${ZPATH}/root/local/home/admin/* -name "*.properties" -exec \ gsed -i -e "/^GF_VERSION=/ s,=*,=v${GF_VER}," {} + print '\nBe patient - glassfish setup may take 3-4 minutes ...\n' cp ${GLASSFISH} ${ZPATH}/root/tmp/ zlogin -l admin ${ZNAME} etc/gf3-setup.sh -f /tmp/${GLASSFISH##*/} #haltZone rebootZone