From 004f6d8755d1a24308b2826771b5a7d8c339aad6 Mon Sep 17 00:00:00 2001 From: "Danilo G. Baio" Date: Sun, 14 Jun 2020 15:17:01 +0000 Subject: net-mgmt/zabbix*: Add status command to the zabbix_java rc script PR: 240139 Submitted by: TAO ZHOU Approved by: maintainer timeout (pg@pakhom.spb.ru, > 9 months) --- net-mgmt/zabbix3-java/Makefile | 1 + net-mgmt/zabbix3-server/files/zabbix_java.in | 20 ++++++++++++++++++++ net-mgmt/zabbix4-java/Makefile | 1 + net-mgmt/zabbix4-server/files/zabbix_java.in | 20 ++++++++++++++++++++ net-mgmt/zabbix42-java/Makefile | 1 + net-mgmt/zabbix42-server/files/zabbix_java.in | 20 ++++++++++++++++++++ net-mgmt/zabbix44-java/Makefile | 1 + net-mgmt/zabbix44-server/files/zabbix_java.in | 20 ++++++++++++++++++++ net-mgmt/zabbix5-java/Makefile | 1 + net-mgmt/zabbix5-server/Makefile | 1 + net-mgmt/zabbix5-server/files/zabbix_java.in | 20 ++++++++++++++++++++ 11 files changed, 106 insertions(+) (limited to 'net-mgmt') diff --git a/net-mgmt/zabbix3-java/Makefile b/net-mgmt/zabbix3-java/Makefile index 7547c35852ef..c96c349f0bff 100644 --- a/net-mgmt/zabbix3-java/Makefile +++ b/net-mgmt/zabbix3-java/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ PORTNAME= zabbix3 +PORTREVISION= 1 CATEGORIES= net-mgmt PKGNAMESUFFIX= -java diff --git a/net-mgmt/zabbix3-server/files/zabbix_java.in b/net-mgmt/zabbix3-server/files/zabbix_java.in index afb4423f9997..ef0f1318c76c 100644 --- a/net-mgmt/zabbix3-server/files/zabbix_java.in +++ b/net-mgmt/zabbix3-server/files/zabbix_java.in @@ -23,5 +23,25 @@ load_rc_config $name start_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/startup.sh" stop_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/shutdown.sh" +status_cmd="zabbix_java_status" + +extra_commands="status" + +zabbix_java_status() { + if get_pidfile_from_conf PID_FILE %%PREFIX%%/sbin/zabbix_java/settings.sh; then + PID_FILE="$_pidfile_from_conf" + fi + + if [ -n "$PID_FILE" -a -f "$PID_FILE" ]; then + PID=`cat "$PID_FILE"` + if ps -p "$PID" > /dev/null 2>&1; then + echo "${name} is running as pid ${PID}" + else + echo "${name} is not running" + fi + else + echo "${name} is not running" + fi +} run_rc_command "$1" diff --git a/net-mgmt/zabbix4-java/Makefile b/net-mgmt/zabbix4-java/Makefile index 6e0624eb552a..4205192abe10 100644 --- a/net-mgmt/zabbix4-java/Makefile +++ b/net-mgmt/zabbix4-java/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ PORTNAME= zabbix4 +PORTREVISION= 1 CATEGORIES= net-mgmt PKGNAMESUFFIX= -java diff --git a/net-mgmt/zabbix4-server/files/zabbix_java.in b/net-mgmt/zabbix4-server/files/zabbix_java.in index afb4423f9997..ef0f1318c76c 100644 --- a/net-mgmt/zabbix4-server/files/zabbix_java.in +++ b/net-mgmt/zabbix4-server/files/zabbix_java.in @@ -23,5 +23,25 @@ load_rc_config $name start_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/startup.sh" stop_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/shutdown.sh" +status_cmd="zabbix_java_status" + +extra_commands="status" + +zabbix_java_status() { + if get_pidfile_from_conf PID_FILE %%PREFIX%%/sbin/zabbix_java/settings.sh; then + PID_FILE="$_pidfile_from_conf" + fi + + if [ -n "$PID_FILE" -a -f "$PID_FILE" ]; then + PID=`cat "$PID_FILE"` + if ps -p "$PID" > /dev/null 2>&1; then + echo "${name} is running as pid ${PID}" + else + echo "${name} is not running" + fi + else + echo "${name} is not running" + fi +} run_rc_command "$1" diff --git a/net-mgmt/zabbix42-java/Makefile b/net-mgmt/zabbix42-java/Makefile index a904772b6199..9f76df5fb417 100644 --- a/net-mgmt/zabbix42-java/Makefile +++ b/net-mgmt/zabbix42-java/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ PORTNAME= zabbix42 +PORTREVISION= 1 CATEGORIES= net-mgmt PKGNAMESUFFIX= -java diff --git a/net-mgmt/zabbix42-server/files/zabbix_java.in b/net-mgmt/zabbix42-server/files/zabbix_java.in index afb4423f9997..ef0f1318c76c 100644 --- a/net-mgmt/zabbix42-server/files/zabbix_java.in +++ b/net-mgmt/zabbix42-server/files/zabbix_java.in @@ -23,5 +23,25 @@ load_rc_config $name start_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/startup.sh" stop_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/shutdown.sh" +status_cmd="zabbix_java_status" + +extra_commands="status" + +zabbix_java_status() { + if get_pidfile_from_conf PID_FILE %%PREFIX%%/sbin/zabbix_java/settings.sh; then + PID_FILE="$_pidfile_from_conf" + fi + + if [ -n "$PID_FILE" -a -f "$PID_FILE" ]; then + PID=`cat "$PID_FILE"` + if ps -p "$PID" > /dev/null 2>&1; then + echo "${name} is running as pid ${PID}" + else + echo "${name} is not running" + fi + else + echo "${name} is not running" + fi +} run_rc_command "$1" diff --git a/net-mgmt/zabbix44-java/Makefile b/net-mgmt/zabbix44-java/Makefile index 1f1f5ae45883..98549757f647 100644 --- a/net-mgmt/zabbix44-java/Makefile +++ b/net-mgmt/zabbix44-java/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ PORTNAME= zabbix44 +PORTREVISION= 2 CATEGORIES= net-mgmt PKGNAMESUFFIX= -java diff --git a/net-mgmt/zabbix44-server/files/zabbix_java.in b/net-mgmt/zabbix44-server/files/zabbix_java.in index afb4423f9997..ef0f1318c76c 100644 --- a/net-mgmt/zabbix44-server/files/zabbix_java.in +++ b/net-mgmt/zabbix44-server/files/zabbix_java.in @@ -23,5 +23,25 @@ load_rc_config $name start_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/startup.sh" stop_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/shutdown.sh" +status_cmd="zabbix_java_status" + +extra_commands="status" + +zabbix_java_status() { + if get_pidfile_from_conf PID_FILE %%PREFIX%%/sbin/zabbix_java/settings.sh; then + PID_FILE="$_pidfile_from_conf" + fi + + if [ -n "$PID_FILE" -a -f "$PID_FILE" ]; then + PID=`cat "$PID_FILE"` + if ps -p "$PID" > /dev/null 2>&1; then + echo "${name} is running as pid ${PID}" + else + echo "${name} is not running" + fi + else + echo "${name} is not running" + fi +} run_rc_command "$1" diff --git a/net-mgmt/zabbix5-java/Makefile b/net-mgmt/zabbix5-java/Makefile index 3aa8f6381ab2..96ec6b87138b 100644 --- a/net-mgmt/zabbix5-java/Makefile +++ b/net-mgmt/zabbix5-java/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ PORTNAME= zabbix5 +PORTREVISION= 1 CATEGORIES= net-mgmt PKGNAMESUFFIX= -java diff --git a/net-mgmt/zabbix5-server/Makefile b/net-mgmt/zabbix5-server/Makefile index 86277456b354..80ecc013961d 100644 --- a/net-mgmt/zabbix5-server/Makefile +++ b/net-mgmt/zabbix5-server/Makefile @@ -3,6 +3,7 @@ PORTNAME= zabbix5 PORTVERSION= 5.0.1 +PORTREVISION?= 0 CATEGORIES= net-mgmt MASTER_SITES= https://cdn.zabbix.com/zabbix/sources/stable/${PORTVERSION:R}/ PKGNAMESUFFIX?= -server diff --git a/net-mgmt/zabbix5-server/files/zabbix_java.in b/net-mgmt/zabbix5-server/files/zabbix_java.in index afb4423f9997..ef0f1318c76c 100644 --- a/net-mgmt/zabbix5-server/files/zabbix_java.in +++ b/net-mgmt/zabbix5-server/files/zabbix_java.in @@ -23,5 +23,25 @@ load_rc_config $name start_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/startup.sh" stop_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/shutdown.sh" +status_cmd="zabbix_java_status" + +extra_commands="status" + +zabbix_java_status() { + if get_pidfile_from_conf PID_FILE %%PREFIX%%/sbin/zabbix_java/settings.sh; then + PID_FILE="$_pidfile_from_conf" + fi + + if [ -n "$PID_FILE" -a -f "$PID_FILE" ]; then + PID=`cat "$PID_FILE"` + if ps -p "$PID" > /dev/null 2>&1; then + echo "${name} is running as pid ${PID}" + else + echo "${name} is not running" + fi + else + echo "${name} is not running" + fi +} run_rc_command "$1" -- cgit v1.2.3