mirror of
https://git.freebsd.org/ports.git
synced 2025-06-24 06:00:30 -04:00
While here, add NO_ARCH PR: 214893 Submitted by: maintainer (freebsd@skinc.ru) MFH: 2016Q4
75 lines
1.9 KiB
Bash
75 lines
1.9 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: kallithea
|
|
# REQUIRE: NETWORKING FILESYSTEMS mountlate
|
|
# KEYWORD: shutdown
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=kallithea
|
|
rcvar=kallithea_enable
|
|
desc="Fast and powerful management tool for Mercurial and Git"
|
|
|
|
load_rc_config ${name}
|
|
|
|
: ${kallithea_enable:=NO}
|
|
: ${kallithea_config=%%PREFIX%%/etc/kallithea.ini}
|
|
: ${kallithea_user:=www}
|
|
: ${kallithea_group:=www}
|
|
: ${kallithea_logfile=/var/log/kallithea/kallithea.log}
|
|
: ${kallithea_pidfile=/var/run/kallithea/kallithea.pid}
|
|
|
|
rcvars="kallithea_config kallithea_user kallithea_group kallithea_logfile kallithea_pidfile"
|
|
kallithea_enable_desc="Set to YES to enable kallithea"
|
|
kallithea_enable_defval=NO
|
|
kallithea_config_desc="Kallithea config file for paster"
|
|
kallithea_config_defval=%%PREFIX%%/etc/kallithea.ini
|
|
kallithea_user_desc="Set the user for paster"
|
|
kallithea_user_defval=www
|
|
kallithea_group_desc="Set the group for paster"
|
|
kallithea_group_defval=www
|
|
kallithea_logfile_desc="Save output to the given log file (redirects stdout)"
|
|
kallithea_logfile_defval=/var/log/kallithea/kallithea.log
|
|
kallithea_pidfile_desc="Save PID to file"
|
|
kallithea_pidfile_defval=/var/run/kallithea/kallithea.pid
|
|
|
|
command=%%PREFIX%%/bin/paster
|
|
pidfile="${kallithea_pidfile}"
|
|
required_files="${kallithea_config}"
|
|
|
|
command_args=" serve --pid-file=${pidfile} --log-file=${kallithea_logfile} --daemon ${kallithea_config}"
|
|
|
|
start_precmd=kallithea_prestart
|
|
status_cmd=kallithea_status
|
|
stop_cmd=kallithea_stop
|
|
|
|
kallithea_prestart()
|
|
{
|
|
for _file in "${kallithea_logfile}" "${pidfile}"; do
|
|
_dir="${_file%/*}"
|
|
if [ ! -e "$_dir" ]; then
|
|
install -d -o ${kallithea_user} "${_dir}"
|
|
elif [ -f "$_dir" ]; then
|
|
echo "Not a directory: $_dir"
|
|
return 20
|
|
fi
|
|
done
|
|
}
|
|
|
|
kallithea_status()
|
|
{
|
|
${command} serve --pid-file=${pidfile} --status ${kallithea_config}
|
|
return $?
|
|
}
|
|
|
|
kallithea_stop()
|
|
{
|
|
echo "Stopping ${name}."
|
|
${command} serve --pid-file=${pidfile} --stop-daemon
|
|
return $?
|
|
}
|
|
|
|
run_rc_command "$1"
|