diff options
author | swills <swills@FreeBSD.org> | 2012-06-30 00:22:41 +0800 |
---|---|---|
committer | swills <swills@FreeBSD.org> | 2012-06-30 00:22:41 +0800 |
commit | 57f6ecae61e6b2be537f8cc19f410df82842b111 (patch) | |
tree | f007b86de0c867bb82d32e1a903b0615b2593fe9 /net-mgmt | |
parent | 08e4043b1edaf242df7d0dd60c894c42359cb183 (diff) | |
download | freebsd-ports-gnome-57f6ecae61e6b2be537f8cc19f410df82842b111.tar.gz freebsd-ports-gnome-57f6ecae61e6b2be537f8cc19f410df82842b111.tar.zst freebsd-ports-gnome-57f6ecae61e6b2be537f8cc19f410df82842b111.zip |
- Fix rc script
- Remove @stopdaemon
- Bump PORTREVISION
PR: ports/169251
Submitted by: Mark Felder <feld@feld.me>
Approved by: Rodrigo OSORIO <rodrigo@bebik.net> (maintainer)
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 |