diff options
author | Steve Wills <swills@FreeBSD.org> | 2012-06-29 16:22:41 +0000 |
---|---|---|
committer | Steve Wills <swills@FreeBSD.org> | 2012-06-29 16:22:41 +0000 |
commit | f71c51f66e07237d2730f77445ab56797e45ecc0 (patch) | |
tree | efd3b0a0ba01c721f4dcbd169323a51133cd8060 /net-mgmt | |
parent | cdd9bb61a71f53ddcc89057d89c579e81b7536bb (diff) | |
download | ports-f71c51f66e07237d2730f77445ab56797e45ecc0.tar.gz ports-f71c51f66e07237d2730f77445ab56797e45ecc0.zip |
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/smokeping/Makefile | 2 | ||||
-rw-r--r-- | net-mgmt/smokeping/files/smokeping.in | 45 | ||||
-rw-r--r-- | net-mgmt/smokeping/pkg-plist | 1 |
3 files changed, 43 insertions, 5 deletions
diff --git a/net-mgmt/smokeping/Makefile b/net-mgmt/smokeping/Makefile index c9d252590a70..95851c6cb14e 100644 --- a/net-mgmt/smokeping/Makefile +++ b/net-mgmt/smokeping/Makefile @@ -7,7 +7,7 @@ PORTNAME= smokeping PORTVERSION= 2.6.7 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net-mgmt www MASTER_SITES= http://oss.oetiker.ch/smokeping/pub/ \ http://smokeping.cs.pu.edu.tw/pub/ diff --git a/net-mgmt/smokeping/files/smokeping.in b/net-mgmt/smokeping/files/smokeping.in index 486652f113a1..95d3e039b404 100644 --- a/net-mgmt/smokeping/files/smokeping.in +++ b/net-mgmt/smokeping/files/smokeping.in @@ -2,7 +2,7 @@ # $FreeBSD$ # PROVIDE: smokeping -# REQUIRE: sshd +# REQUIRE: LOGIN # KEYWORD: shutdown # Define these smokeping_* variables in one of these files: @@ -23,7 +23,7 @@ smokeping_group=${smokeping_group-"%%GROUPS%%"} . /etc/rc.subr name="smokeping" -rcvar=smokeping_enable +rcvar="smokeping_enable" load_rc_config $name command="/usr/local/bin/smokeping" command_args="--logfile=${smokeping_logfile}" @@ -31,11 +31,50 @@ pidfile="${smokeping_pidfile}" extra_commands="reload" reload_cmd="smokeping_reloadcmd" +start_precmd="smokeping_startprecmd" +stop_cmd="smokeping_stopcmd" +status_cmd="smokeping_statuscmd" smokeping_reloadcmd() { $command --reload } -run_rc_command "$1" +smokeping_statuscmd() +{ + if [ ! -e $pidfile ]; + then + echo "pidfile does not exist. $name is not running?"; + exit 1; + fi + + if pgrep -F $pidfile >/dev/null; + then + echo "$name is running."; + else + echo "$name is not running."; + exit 1; + fi +} +smokeping_stopcmd() +{ + if pgrep -F $pidfile >/dev/null; + then + kill $sig_stop `cat $pidfile`; + wait_for_pids `cat $pidfile`; + else + echo "$name is not running."; + exit 1; + fi +} + +smokeping_startprecmd() +{ + if [ ! -e $smokeping_logfile ]; + then + install -o %%USERS%% -g %%GROUPS%% /dev/null $smokeping_logfile || echo "ERROR: Could not initialize logfile at $smokeping_logfile."; + fi +} + +run_rc_command "$1" diff --git a/net-mgmt/smokeping/pkg-plist b/net-mgmt/smokeping/pkg-plist index 86922bb1130a..696f03202b4e 100644 --- a/net-mgmt/smokeping/pkg-plist +++ b/net-mgmt/smokeping/pkg-plist @@ -1,4 +1,3 @@ -@stopdaemon smokeping bin/smokeinfo bin/smokeping bin/smokeping_cgi |