Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ctaclinux
zabbix
zabbix-java-gateway.init
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File zabbix-java-gateway.init of Package zabbix
#! /bin/sh # # chkconfig: - 85 15 # description: zabbix java gateway # ### BEGIN INIT INFO # Provides: zabbix # Required-Start: $local_fs $network # Required-Stop: $local_fs $network # Default-Start: 7 # Default-Stop: 0 1 2 3 4 5 6 # Short-Description: start and stop zabbix java gateway # Description: Zabbix Java Gateway ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Source Zabbix Java Gateway configuration . /etc/zabbix/zabbix_java_gateway.conf if [ -r "/etc/sysconfig/zabbix-java-gateway" ]; then . /etc/sysconfig/zabbix-java-gateway fi # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 RETVAL=0 EXECDIR=/usr/sbin/zabbix_java case "$1" in start) echo -n "Starting zabbix java gateway: " if [ -n "$PID_FILE" -a -e "$PID_FILE" ]; then echo "zabbix java gateway is already running" exit 1 fi JAVA=${JAVA:-java} JAVA_OPTIONS="-server $JAVA_OPTIONS" if [ -z "$PID_FILE" ]; then JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=logback-console.xml" fi cd $EXECDIR CLASSPATH="lib" for jar in {lib,bin}/*.jar; do if [[ $jar != *junit* ]]; then CLASSPATH="$CLASSPATH:$jar" fi done ZABBIX_OPTIONS="" if [ -n "$PID_FILE" ]; then ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.pidFile=$PID_FILE" fi if [ -n "$LISTEN_IP" ]; then ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenIP=$LISTEN_IP" fi if [ -n "$LISTEN_PORT" ]; then ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenPort=$LISTEN_PORT" fi if [ -n "$START_POLLERS" ]; then ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.startPollers=$START_POLLERS" fi COMMAND_LINE="$JAVA $JAVA_OPTIONS -classpath $CLASSPATH $ZABBIX_OPTIONS com.zabbix.gateway.JavaGateway" if [ -n "$PID_FILE" ]; then PID=$(su -s /bin/bash -c "$COMMAND_LINE > /dev/null 2>&1 & echo \$!" zabbix) if ps -p $PID > /dev/null 2>&1; then echo $PID > $PID_FILE else echo "zabbix java gateway did not start" exit 1 fi else exec $COMMAND_LINE RETVAL=$? fi ;; stop) echo -n "Shutting down zabbix java gateway: " if [ -n "$PID_FILE" ]; then if [ -e "$PID_FILE" ]; then kill `cat $PID_FILE` && rm $PID_FILE else echo "zabbix java gateway is not running" exit 1 fi else echo "zabbix java gateway is not configured as a daemon: variable \$PID_FILE is not set" exit 1 fi ;; restart) $0 stop $0 start RETVAL=$? ;; condrestart) if [ -n "$PID_FILE" -a -e "$PID_FILE" ]; then $0 stop $0 start fi RETVAL=$? ;; status) status -p $PID_FILE $0 RETVAL=$? exit $RETVAL ;; *) echo "Usage: $0 {start|stop|restart|condrestart|status}" exit 1 ;; esac [ "$RETVAL" -eq 0 ] && success $"$base startup" || failure $"$base startup" echo exit $RETVAL
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor