From owner-svn-ports-head@freebsd.org Wed Sep 21 15:22:07 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E22DABE4992; Wed, 21 Sep 2016 15:22:07 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9B6F51878; Wed, 21 Sep 2016 15:22:07 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8LFM6Nk011142; Wed, 21 Sep 2016 15:22:06 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8LFM6YX011140; Wed, 21 Sep 2016 15:22:06 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201609211522.u8LFM6YX011140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Wed, 21 Sep 2016 15:22:06 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r422566 - in head/net-mgmt/unifi4: . 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.23 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: Wed, 21 Sep 2016 15:22:08 -0000 Author: feld Date: Wed Sep 21 15:22:06 2016 New Revision: 422566 URL: https://svnweb.freebsd.org/changeset/ports/422566 Log: net-mgmt/unifi4: Simplify rc script Modified: head/net-mgmt/unifi4/Makefile head/net-mgmt/unifi4/files/unifi.in Modified: head/net-mgmt/unifi4/Makefile ============================================================================== --- head/net-mgmt/unifi4/Makefile Wed Sep 21 15:20:42 2016 (r422565) +++ head/net-mgmt/unifi4/Makefile Wed Sep 21 15:22:06 2016 (r422566) @@ -3,7 +3,7 @@ PORTNAME= unifi4 PORTVERSION= 4.8.20 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= net-mgmt java MASTER_SITES= https://www.ubnt.com/downloads/unifi/${PORTVERSION}/ \ LOCAL/feld/${PORTNAME}-${PORTVERSION}/ @@ -18,7 +18,8 @@ RUN_DEPENDS= mongodb>0:databases/mongodb BUILD= 8422 -SUB_LIST+= USERS=${USERS} GROUPS=${GROUPS} JAVASHAREDIR=${JAVASHAREDIR} +SUB_LIST+= USERS=${USERS} GROUPS=${GROUPS} JAVASHAREDIR=${JAVASHAREDIR} \ + JAVA=${JAVA} PLIST_SUB+= BUILDVERSION="${PORTVERSION:S/./_/g}_${BUILD}" USES= cpe zip Modified: head/net-mgmt/unifi4/files/unifi.in ============================================================================== --- head/net-mgmt/unifi4/files/unifi.in Wed Sep 21 15:20:42 2016 (r422565) +++ head/net-mgmt/unifi4/files/unifi.in Wed Sep 21 15:22:06 2016 (r422566) @@ -25,16 +25,11 @@ load_rc_config ${name} : ${unifi_chdir=%%JAVASHAREDIR%%/unifi} : ${unifi_javaflags:="-Djava.awt.headless=true -Xmx1024M"} -command_interpreter=. -command="%%PREFIX%%/bin/java" -command_args="${unifi_javaflags} -jar lib/ace.jar" -start_cmd=start_cmd +pidfile="/var/run/unifi/${name}.pid" +procname=%%JAVA%% +command="/usr/sbin/daemon" +command_args="-f -p ${pidfile} %%JAVA%% ${unifi_javaflags} -jar lib/ace.jar start" start_precmd=start_precmd -stop_cmd=stop_cmd -status_cmd=status_cmd -pidfile="/var/run/${name}.pid" - -procname=$(JAVAVM_DRYRUN=yes ${command} | fgrep JAVAVM_COMMAND) start_precmd() { @@ -43,33 +38,4 @@ start_precmd() fi } -start_cmd() -{ - check_startmsgs && echo "Starting ${name}." - cd ${unifi_chdir} - daemon -u %%USERS%% -f -p ${pidfile} ${command} ${command_args} start -} - -stop_cmd() -{ - check_startmsgs && echo "Stopping ${name}." - rc_pid=$(check_pidfile $pidfile $procname) - cd ${unifi_chdir} - ${command} ${command_args} stop - wait_for_pids $rc_pid -} - -status_cmd() -{ - if [ -e ${pidfile} ] && $(pgrep -F ${pidfile} > /dev/null) ; then - mypid=$(cat ${pidfile}) - fi - - if [ ! ${mypid} = '' ]; then - echo "${name} is running with PID ${mypid}."; - else - echo "${name} not running?"; - fi -} - run_rc_command "$1"