Lieber Besucher, herzlich willkommen bei: GentooForum.de. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
#!/bin/sh case "$1" in start) ps `cat /etc/pbeagent.pid 2>/dev/null | awk "{ print "'$1'" }"` | grep Dpicard.main.thread > /dev/null if [ $? = 0 -a -e /etc/pbeagent.pid ] then echo Process Already Started. Cannot start twice. else cd /opt/APC/PowerChuteBusinessEdition/Agent export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/APC/PowerChuteBusinessEdition/Agent/lib/linux /bin/java/jre/1.4.2_11/bin/java -Dpicard.main.thread=blocking -classpath ./lib/AdvSnmp.jar:./lib/application.jar:./lib/jsdk.jar:./lib/comm.jar:./lib/mail.jar:./lib/RXTXComm.jar:./lib/activation.jar:./lib/util.jar:./lib/m11.jar:./lib/ds.jar:./lib/sss.jar:./lib/pcbe_ds.jar:./comp/AliCommunication.jar:./comp/CommandFileRunner.jar:./comp/DataLogger.jar:./comp/DiscoveryListener.jar:./comp/EventLogger.jar:./comp/EventTracker.jar:./comp/Host.jar:./comp/http.jar:./comp/picard.jar:./comp/PowerSource.jar:./comp/QueryServer.jar:./comp/Security.jar:./comp/ShutdownBehavior.jar:./comp/Shutdowner.jar:./comp/SimpleBroadcaster.jar:./comp/SMTPMailer.jar:./comp/UPSManagerAutoUpdate.jar:./comp/shutdownerlets/OSShutdownerlet.jar:./comp/shutdownerlets/ExchangeShutdownerlet.jar:./comp/shutdownerlets/IISShutdownerlet.jar:./comp/shutdownerlets/NotesShutdownerlet.jar:./comp/shutdownerlets/SQLShutdownerlet.jar:./comp/shutdownerlets/SiebelShutdownerlet.jar:./Resources/Japanese.jar com.apcc.m11.application.PicardApplication @critical.cfg 2>/dev/null 1>/dev/null & echo $! >/etc/pbeagent.pid touch /var/lock/subsys/PBEAgent 1>/dev/null 2>/dev/null exit $? fi ;; stop) PID=`cat /etc/pbeagent.pid 2>/dev/null | awk "{ print "'$1'" }"` kill $PID 1>/dev/null 2>/dev/null rm -f /etc/pbeagent.pid 1>/dev/null 2>/dev/null rm -f /var/lock/subsys/PBEAgent 1>/dev/null 2>/dev/null exit $? ;; status) ps `cat /etc/pbeagent.pid 2>/dev/null | awk "{ print "'$1'" }"` | grep Dpicard.main.thread > /dev/null if [ $? = 0 -a -e /etc/pbeagent.pid ] then echo Running else echo Stopped fi ;; *) echo "Usage $0 {start|stop|status}" exit 1 ;; esac |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »akkie« (26.09.2008, 20:43)
Quellcode |
|
1 |
#!/bin/sh |
Zitat
ist schonmal falsch.
Ebenso sollte das Starten und Beenden mittels start-stop-daemon erledigt werden (dann müsste das Problem mit der PID auch gelöst sein).
Quellcode |
|
1 2 3 |
cd /opt/APC/PowerChuteBusinessEdition/Agent export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/APC/PowerChuteBusinessEdition/Agent/lib/linux /bin/java/jre/1.4.2_11/bin/java -Dpicard.main.thread=blocking -classpath ./lib/AdvSnmp.jar:./lib/application.jar:./lib/jsdk.jar:./lib/comm.jar:./lib/mail.jar:./lib/RXTXComm.jar:./lib/activation.jar:./lib/util.jar:./lib/m11.jar:./lib/ds.jar:./lib/sss.jar:./lib/pcbe_ds.jar:./comp/AliCommunication.jar:./comp/CommandFileRunner.jar:./comp/DataLogger.jar:./comp/DiscoveryListener.jar:./comp/EventLogger.jar:./comp/EventTracker.jar:./comp/Host.jar:./comp/http.jar:./comp/picard.jar:./comp/PowerSource.jar:./comp/QueryServer.jar:./comp/Security.jar:./comp/ShutdownBehavior.jar:./comp/Shutdowner.jar:./comp/SimpleBroadcaster.jar:./comp/SMTPMailer.jar:./comp/UPSManagerAutoUpdate.jar:./comp/shutdownerlets/OSShutdownerlet.jar:./comp/shutdownerlets/ExchangeShutdownerlet.jar:./comp/shutdownerlets/IISShutdownerlet.jar:./comp/shutdownerlets/NotesShutdownerlet.jar:./comp/shutdownerlets/SQLShutdownerlet.jar:./comp/shutdownerlets/SiebelShutdownerlet.jar:./Resources/Japanese.jar com.apcc.m11.application.PicardApplication @critical.cfg 2>/dev/null 1>/dev/null & |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#!/sbin/runscript PATH_TO_AGENT="/opt/APC/PowerChuteBusinessEdition/Agent" JAVA="/bin/java/jre/1.4.2_11/bin/java" LIB_PATH="/opt/APC/PowerChuteBusinessEdition/Agent/lib/linux" CLASS_PATH="-classpath ./lib/AdvSnmp.jar:./lib/application.jar:./lib/jsdk.jar:./lib/comm.jar:./lib/mail.jar:./lib/RXTXComm.jar:./lib/activation.jar:./lib/util.jar:./lib/m11.jar:./lib/ds.jar:./lib/sss.jar:./lib/pcbe_ds.jar:./comp/AliCommunication.jar:./comp/CommandFileRunner.jar:./comp/DataLogger.jar:./comp/DiscoveryListener.jar:./comp/EventLogger.jar:./comp/EventTracker.jar:./comp/Host.jar:./comp/http.jar:./comp/picard.jar:./comp/PowerSource.jar:./comp/QueryServer.jar:./comp/Security.jar:./comp/ShutdownBehavior.jar:./comp/Shutdowner.jar:./comp/SimpleBroadcaster.jar:./comp/SMTPMailer.jar:./comp/UPSManagerAutoUpdate.jar:./comp/shutdownerlets/OSShutdownerlet.jar:./comp/shutdownerlets/ExchangeShutdownerlet.jar:./comp/shutdownerlets/IISShutdownerlet.jar:./comp/shutdownerlets/NotesShutdownerlet.jar:./comp/shutdownerlets/SQLShutdownerlet.jar:./comp/shutdownerlets/SiebelShutdownerlet.jar:./Resources/Japanese.jar" pidfile=/var/run/apc_agent.pid USER="root:root" depend() { need localmount before hald } start(){ ebegin "Starting APC-Agent" start-stop-daemon --start --pidfile $pidfile --make-pid --background --chuid "$USER" --chdir "$PATH_TO_AGENT" --env LD_LIBRARY_PATH=$LIB_PATH --exec $JAVA -- -Dpicard.main.thread=blocking $CLASS_PATH com.apcc.m11.application.PicardApplication @critical.cfg 2>/dev/null 1>/dev/null eend $? } stop(){ ebegin "Stopping APC-Agent" start-stop-daemon --stop --pidfile $pidfile --name $JAVA eend $? } |