diff --git a/net-mgmt/smokeping/Makefile b/net-mgmt/smokeping/Makefile index 595446a054c6..d59273de8337 100644 --- a/net-mgmt/smokeping/Makefile +++ b/net-mgmt/smokeping/Makefile @@ -1,95 +1,95 @@ PORTNAME= smokeping PORTVERSION= 2.8.2 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= net-mgmt www MASTER_SITES= https://oss.oetiker.ch/smokeping/pub/ MAINTAINER= rodrigo@FreeBSD.org COMMENT= Latency logging and graphing system WWW= https://oss.oetiker.ch/smokeping/ LICENSE= GPLv2 BUILD_DEPENDS= curl>=0:ftp/curl \ p5-CGI-Fast>=0:www/p5-CGI-Fast \ p5-CGI-Session>=0:www/p5-CGI-Session \ p5-CGI>=0:www/p5-CGI \ p5-Config-Grammar>=0:devel/p5-Config-Grammar \ p5-Digest-HMAC>=0:security/p5-Digest-HMAC \ p5-FCGI>=0:www/p5-FCGI \ p5-IO-Pty-Easy>=0:devel/p5-IO-Pty-Easy \ p5-IO-Socket-SSL>=0:security/p5-IO-Socket-SSL \ p5-libwww>=0:www/p5-libwww \ p5-LWP-Protocol-https>=0:www/p5-LWP-Protocol-https \ p5-Net-DNS>=0:dns/p5-Net-DNS \ p5-Net-OpenSSH>=0:net/p5-Net-OpenSSH \ p5-Net-SNMP>=0:net-mgmt/p5-Net-SNMP \ p5-Net-Telnet>=0:net/p5-Net-Telnet \ p5-OrePAN2>=0:devel/p5-OrePAN2 \ p5-perl-ldap>=0:net/p5-perl-ldap \ p5-SNMP_Session>=0:net-mgmt/p5-SNMP_Session \ p5-Socket6>=0:net/p5-Socket6 LIB_DEPENDS= librrd.so:databases/rrdtool RUN_DEPENDS:= ${BUILD_DEPENDS} USES= autoreconf cpe gmake perl5 USE_RC_SUBR= smokeping GNU_CONFIGURE= yes GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share CONFIGURE_ARGS+= --libdir=${PREFIX}/smokeping/lib \ --localstatedir="${PREFIX}/var" \ --sysconfdir=${ETCDIR} \ --with-htdocs-dir=${PREFIX}/smokeping/htdocs CONFIGURE_ENV+= PERL5LIB=${PREFIX}/smokeping/lib \ PERL=${PERL} CONFLICTS_INSTALL= nfsping NO_ARCH= yes SUB_FILES= pkg-deinstall pkg-message SUB_LIST= GROUPS=${GROUPS} \ USERS=${USERS} HTDOCSDIR= ${PREFIX}/smokeping/htdocs USERS= smokeping GROUPS= smokeping PKGDEINSTALL= ${WRKDIR}/pkg-deinstall OPTIONS_DEFINE= DNS ECHOPING EXAMPLES FPING RADIUS TELNET OPTIONS_DEFAULT= FPING DNS_DESC= Support for AnotherDNS probes ECHOPING_DESC= Support for EchoPing probes FPING_DESC= Support for fping probes RADIUS_DESC= Support for Radius probes TELNET_DESC= Support for TelnetIOSPing probes DNS_RUN_DEPENDS= p5-Net-DNS>=0:dns/p5-Net-DNS ECHOPING_RUN_DEPENDS= ${LOCALBASE}/bin/echoping:net/echoping FPING_RUN_DEPENDS= ${LOCALBASE}/sbin/fping:net/fping RADIUS_RUN_DEPENDS= p5-Authen-Radius>=0:security/p5-Authen-Radius TELNET_RUN_DEPENDS= p5-Net-Telnet>=0:net/p5-Net-Telnet # We will take these from CPAN instead post-extract: cd ${WRKSRC}/lib ; ${RM} BER.pm SNMP_util.pm SNMP_Session.pm post-patch: ${REINPLACE_CMD} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${WRKSRC}/doc/Makefile.am \ ${WRKSRC}/bin/smokeping \ ${WRKSRC}/bin/smokeping_cgi \ ${WRKSRC}/bin/tSmoke @for a in ${WRKSRC}/etc/*.dist; do \ ${MV} $$a $${a%.dist}.sample; \ done ${MV} ${WRKSRC}/etc/config.dist.in ${WRKSRC}/etc/config.sample.in post-install: ${MKDIR} ${STAGEDIR}/${PREFIX}/smokeping/htdocs/img ${MKDIR} ${STAGEDIR}/${PREFIX}/var/smokeping .include diff --git a/net-mgmt/smokeping/files/smokeping.in b/net-mgmt/smokeping/files/smokeping.in index 54162f708760..d125d643e62e 100644 --- a/net-mgmt/smokeping/files/smokeping.in +++ b/net-mgmt/smokeping/files/smokeping.in @@ -1,111 +1,112 @@ #!/bin/sh # Created by: Sean McAfee # PROVIDE: smokeping # REQUIRE: LOGIN # KEYWORD: shutdown # Define these smokeping_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/smokeping # # DO NOT CHANGE THESE DEFAULT VALUES HERE # # smokeping_flags="" . /etc/rc.subr name=smokeping rcvar=smokeping_enable extra_commands="status configtest reload" start_cmd="smokeping_start" status_cmd="smokeping_status" configtest_cmd="smokeping_configtest" reload_cmd="smokeping_reload" stop_cmd="smokeping_stop" : ${smokeping_enable:=NO} -# pidfile is hardcoded in Smokeping.pm, not configurable -smokeping_pidfile="%%PREFIX%%/var/smokeping/pid" +# piddir is configured in %%PREFIX%%/etc/smokeping/config +# pid file name is "pid" and harcoded in Smokeping.pm, not configurable +: ${smokeping_pidfile="%%PREFIX%%/var/smokeping/pid"} : ${smokeping_logfile=/var/log/smokeping.log} : ${smokeping_user="%%USERS%%"} : ${smokeping_group="%%GROUPS%%"} command="%%PREFIX%%/bin/smokeping" command_args="--logfile=${smokeping_logfile}" pidfile="${smokeping_pidfile}" command_interpreter="%%PREFIX%%/bin/perl" smokeping_check_pidfile() { rc_pid=$(check_pidfile $pidfile $command) if [ -z "${rc_pid}" ]; then rc_pid=$(check_pidfile $pidfile $command $command_interpreter) fi } smokeping_start() { smokeping_check_pidfile if [ -n "$rc_pid" ]; then echo 1>&2 "${name} already running? (pid=$rc_pid)." return 1 fi if [ ! -e ${smokeping_logfile} ]; then install -o ${smokeping_user} -g ${smokeping_group} -m 644 /dev/null ${smokeping_logfile} ||\ echo "ERROR: Could not initialize logfile at ${smokeping_logfile}."; fi echo "Starting ${name}." su -m ${smokeping_user} -c "sh -c '${command} ${smokeping_flags} ${command_args}'" } smokeping_status() { smokeping_check_pidfile if [ -z "$rc_pid" ]; then echo "${name} is not running." return 1 else echo "${name} is running as pid $rc_pid" fi } smokeping_configtest() { ${command} --check } smokeping_reload() { smokeping_check_pidfile if [ -z "$rc_pid" ]; then _run_rc_notrunning return 1 else ${command} --reload fi } smokeping_stop() { smokeping_check_pidfile if [ -z "$rc_pid" ]; then _run_rc_notrunning return 1 else echo "Stopping ${name}." kill -TERM $rc_pid wait_for_pids $rc_pid fi } load_rc_config $name run_rc_command "$1"