ports/devel/phabricator/files/phd.in
Michael Gmelin 4d00cc9900 Don't run shebangfix on symlinks
This isn't allowed on CURRENT any more and created copies of
files where symlinks should have been preserved. Also makes
patching files in bin unnecessary.

Reported by:	rozhuk.im@gmail.com
2017-07-01 23:10:49 +00:00

57 lines
1.1 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: phd
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable phabricator daemons:
# phd_enable (bool): Set to "NO" by default
# Set it to "YES" to enable phd
# phd_fib (str): Set an altered default network view for phd
# phd_user (str): User to run phabricator daemons as
. /etc/rc.subr
name="phd"
rcvar=phd_enable
load_rc_config "$name"
: ${phd_enable="NO"}
: ${phd_user="www"}
command="%%PREFIX%%/lib/php/phabricator/bin/phd"
extra_commands="launch list log"
poll_cmd="phd_poll"
stop_cmd="${command} stop"
status_cmd="${command} status"
restart_cmd="phd_restart"
launch_cmd="${command} launch"
list_cmd="${command} list"
log_cmd="${command} log"
start_precmd="eval command_args=start"
required_files="%%PREFIX%%/lib/php/phabricator/conf/local/local.json"
PATH="${PATH}:%%PREFIX%%/bin"
phd_poll()
{
pids=`${status_cmd} 2>/dev/null | awk '{ print $4 }' | egrep "^[0-9]+$" | sort | uniq`
wait_for_pids $pids
}
phd_restart()
{
${stop_cmd}
phd_poll
run_rc_command start
}
run_rc_command "$*"