mirror of
https://git.freebsd.org/ports.git
synced 2025-07-01 17:40:40 -04:00
- Update to 1.7.2 - Fix start rc.d script Changes: https://secure.rhodecode.org/rhodecode/files/fc64cd9bb85636f614215addae45b88dab12cd98/docs/changelog.rst
68 lines
1.5 KiB
Bash
68 lines
1.5 KiB
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
# PROVIDE: rhodecode
|
|
# REQUIRE: NETWORKING
|
|
#
|
|
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
|
# to enable this service:
|
|
#
|
|
# rhodecode_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable rhodecode.
|
|
# rhodecode_config (string):
|
|
# rhodecode config file for paster
|
|
# rhodecode_user (string):
|
|
# User to run rhodecode
|
|
# rhodecode_group (string):
|
|
# Group to run rhodecode
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="rhodecode"
|
|
rcvar=rhodecode_enable
|
|
|
|
load_rc_config ${name}
|
|
|
|
: ${rhodecode_enable="NO"}
|
|
: ${rhodecode_config="%%PREFIX%%/etc/rhodecode/production.ini"}
|
|
: ${rhodecode_user="www"}
|
|
: ${rhodecode_group="www"}
|
|
|
|
pidfile="/var/run/${name}/${name}.pid"
|
|
logfile="/var/run/${name}.log"
|
|
command=%%PREFIX%%/bin/paster
|
|
start_precmd="install -d -o ${rhodecode_user} ${pidfile%/*} && install -o ${rhodecode_user} /dev/null ${logfile}"
|
|
start_cmd="rhodecode_start"
|
|
status_cmd="rhodecode_status"
|
|
stop_cmd="rhodecode_stop"
|
|
|
|
rhodecode_start() {
|
|
${command} serve \
|
|
--user=${rhodecode_user} \
|
|
--group=${rhodecode_group} \
|
|
--pid-file=${pidfile} \
|
|
--log-file=${logfile} \
|
|
--daemon \
|
|
${rhodecode_config}
|
|
}
|
|
|
|
rhodecode_status() {
|
|
${command} serve \
|
|
--pid-file=${pidfile}\
|
|
--status \
|
|
${rhodecode_config}
|
|
}
|
|
|
|
rhodecode_stop() {
|
|
${command} serve \
|
|
--user=${rhodecode_user} \
|
|
--group=${rhodecode_group} \
|
|
--pid-file=${pidfile} \
|
|
--stop-daemon \
|
|
${rhodecode_config}
|
|
}
|
|
|
|
required_files="${rhodecode_config}"
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|