#!/sbin/runscript # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later # $Header: $ pidfile=/var/run/storagnt.pid description="Adaptec Storage Agent" name="StorAgnt" instdir=/opt/StorMan depend() { after net } checkconfig () { if [[ -z "${JAVAHOME}" ]]; then eerror "JAVAHOME is not set!" eerror "You need to configure $name in /etc/conf.d/$name." return 1 fi return 0 } setenv () { unset JAVA_HOME CLASSPATH JFLAGS JAVA_HOME="${JAVAHOME}" JAVA_BIN=$JAVA_HOME/jre/bin JAVA_LIB=$JAVA_HOME/jre/lib LD_LIBRARY_PATH=$instdir:$LD_LIBRARY_PATH if [ -f $instdir/libstdc++.so.5 ] && ldd $instdir/libSTORUTIL.so | grep libstdc++.so.5 > /dev/null 2>&1 then LD_PRELOAD=$instdir/libstdc++.so.5 elif [ -f /usr/lib/libstdc++.so.5 ] then LD_PRELOAD=/usr/lib/libstdc++.so.5 else eerror "Couldn't find shared library 'libstdc++.so.5'" eerror "You need to install 'sys-libs/libstdc++-v3' or >=app-admin/asm-6.10.18359" return 1 fi export LD_LIBRARY_PATH JAVA_HOME JAVA_BIN JAVA_LIB CLASSPATH LD_PRELOAD return 0 } start() { checkconfig || return 1 setenv || return 1 ebegin "Starting Adaptec Storage Agent" start-stop-daemon --quiet --start --make-pidfile --pidfile "${pidfile}" \ --background --exec "$JAVA_BIN/java" -- -Djava.compiler=NONE -cp $instdir/RaidMan.jar com.ibm.sysmgt.raidmgr.agent.ManagementAgent $* eend $? "Failed to start Adaptec Storage Agent" } stop() { ebegin "Stopping Adaptec Storage Agent" start-stop-daemon --stop -q --pidfile "${pidfile}" eend $? "Failed to stop Adaptec Storage Agent" }