svn commit: r422566 - in head/net-mgmt/unifi4: . files
Mark Felder
feld at FreeBSD.org
Wed Sep 21 15:22:08 UTC 2016
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"
More information about the svn-ports-head
mailing list