From owner-svn-ports-head@FreeBSD.ORG Sat Feb 21 16:50:32 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CCEAAC7; Sat, 21 Feb 2015 16:50:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F26C5B60; Sat, 21 Feb 2015 16:50:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LGoV5m051362; Sat, 21 Feb 2015 16:50:31 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1LGoV8V051274; Sat, 21 Feb 2015 16:50:31 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201502211650.t1LGoV8V051274@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Sat, 21 Feb 2015 16:50:31 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r379535 - in head/net-mgmt/xymon-client: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2015 16:50:32 -0000 Author: feld Date: Sat Feb 21 16:50:30 2015 New Revision: 379535 URL: https://svnweb.freebsd.org/changeset/ports/379535 QAT: https://qat.redports.org/buildarchive/r379535/ Log: Execute the xymonlaunch process directly. The supplied runclient.sh script duplicates much of the rc script and adds unnecessary complexity. While here ensure that leftover processes are cleaned up. This also fixes a recent regression which prevented xymon-client from reliably starting on boot. PR: 197827 Modified: head/net-mgmt/xymon-client/Makefile head/net-mgmt/xymon-client/files/xymon-client.in Modified: head/net-mgmt/xymon-client/Makefile ============================================================================== --- head/net-mgmt/xymon-client/Makefile Sat Feb 21 16:30:34 2015 (r379534) +++ head/net-mgmt/xymon-client/Makefile Sat Feb 21 16:50:30 2015 (r379535) @@ -2,7 +2,7 @@ PORTNAME= xymon PORTVERSION= 4.3.18 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= net-mgmt www MASTER_SITES= SF/xymon/Xymon/${PORTVERSION} PKGNAMESUFFIX= -client${PKGNAMESUFFIX2} Modified: head/net-mgmt/xymon-client/files/xymon-client.in ============================================================================== --- head/net-mgmt/xymon-client/files/xymon-client.in Sat Feb 21 16:30:34 2015 (r379534) +++ head/net-mgmt/xymon-client/files/xymon-client.in Sat Feb 21 16:50:30 2015 (r379535) @@ -16,10 +16,48 @@ load_rc_config "$name" : ${xymon_client_enable:=NO} : ${xymon_client_user:=%%XYMONUSER%%} -command=%%WWWDIR%%/client/runclient.sh -command_args="${xymon_client_flags} ${1}" -procname=%%WWWDIR%%/client/bin/xymonlaunch pidfile="%%WWWDIR%%/client/logs/clientlaunch.`hostname`.pid" -start_precmd="chown -R ${xymon_client_user} %%WWWDIR%%/client/logs" +command=%%WWWDIR%%/client/bin/xymonlaunch +command_args="--config=%%WWWDIR%%/client/etc/clientlaunch.cfg --log=%%WWWDIR%%/client/logs/clientlaunch.log --pidfile=${pidfile}" +start_precmd=xymon_precmd +# Clean up leftover children +stop_postcmd="pkill -U ${xymon_client_user}" + +xymon_precmd() +{ + # Don't actually pass $xymon_client_flags to $command + rc_flags="" + + # Ensure permissions of log dir + chown -R ${xymon_client_user} %%WWWDIR%%/client/logs + + # Below is pulled almost directly from Xymon's runclient.sh script which we are bypassing due to redundancy + + # Default settings for this client + MACHINEDOTS="`uname -n`" + SERVEROSTYPE="`uname -s | tr '[ABCDEFGHIJKLMNOPQRSTUVWXYZ/]' '[abcdefghijklmnopqrstuvwxyz_]'"` + XYMONOSSCRIPT="xymonclient-$SERVEROSTYPE.sh" + XYMONCLIENTHOME="%%WWWDIR%%/client" + + for i in $xymon_client_flags; do + case "$i" in + --hostname=*) + MACHINEDOTS="`echo $i | sed -e 's/--hostname=//'`" + ;; + --os=*) + SERVEROSTYPE="`echo $i | sed -e 's/--os=//' | tr '[ABCDEFGHIJKLMNOPQRSTUVWXYZ/]' '[abcdefghijklmnopqrstuvwxyz_]'`" + ;; + --class=*) + CONFIGCLASS="`echo $i | sed -e 's/--class=//' | tr '[ABCDEFGHIJKLMNOPQRSTUVWXYZ/]' '[abcdefghijklmnopqrstuvwxyz_]'`" + ;; + esac + shift + done + + export MACHINEDOTS SERVEROSTYPE XYMONOSSCRIPT XYMONCLIENTHOME CONFIGCLASS + + MACHINE="`echo $MACHINEDOTS | sed -e 's/\./,/g'`" + export MACHINE +} run_rc_command "$1"