mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-13 07:34:50 +00:00
www/gitlab-pages: fix rc script
This commit is contained in:
parent
cf81b6a93b
commit
f8eebf705d
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=468171
@ -2,6 +2,7 @@
|
||||
|
||||
PORTNAME= gitlab-pages
|
||||
PORTVERSION= 0.7.1
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= www
|
||||
|
||||
MAINTAINER= swills@FreeBSD.org
|
||||
|
@ -17,6 +17,8 @@
|
||||
# Set it to user to run gitlab_pages under
|
||||
# gitlab_pages_group (str): Set to "gitlab-pages" by default.
|
||||
# Set it to group to run gitlab-pages under
|
||||
# gitlab_pages_logfile (str): Set to "/var/log/gitlab_pages.log" by default.
|
||||
# Set it to file to send gitlab-pages logs to
|
||||
#
|
||||
|
||||
. /etc/rc.subr
|
||||
@ -30,28 +32,30 @@ load_rc_config $name
|
||||
: ${gitlab_pages_dir:="/var/tmp/gitlab_pages"}
|
||||
: ${gitlab_pages_user:="gitlab-pages"}
|
||||
: ${gitlab_pages_group:="gitlab-pages"}
|
||||
: ${gitlab_pages_logfile:="/var/log/gitlab_pages.log"}
|
||||
|
||||
export HOME=${gitlab_pages_dir}
|
||||
export PATH=${PATH}:%%PREFIX%%/bin
|
||||
|
||||
pidfile="/var/run/${name}.pid"
|
||||
command="/usr/sbin/daemon"
|
||||
command_args="-f -p ${pidfile} %%PREFIX%%/bin/gitlab-pages run"
|
||||
gitlab_pages_chdir="${gitlab_pages_dir}"
|
||||
|
||||
procname=%%PREFIX%%/bin/gitlab-pages
|
||||
|
||||
start_precmd="gitlab_pages_startprecmd"
|
||||
start_cmd="gitlab_pages_startcmd"
|
||||
list_cmd="listfunc"
|
||||
register_cmd="registerfunc"
|
||||
|
||||
listfunc()
|
||||
{
|
||||
cd ${gitlab_pages_chdir} ; \
|
||||
su -m ${gitlab_pages_user} -c "env HOME=${gitlab_pages_dir} %%PREFIX%%/bin/gitlab-pages list"
|
||||
}
|
||||
|
||||
registerfunc()
|
||||
{
|
||||
cd ${gitlab_pages_chdir} ; \
|
||||
su -m ${gitlab_pages_user} -c "env HOME=${gitlab_pages_dir} %%PREFIX%%/bin/gitlab-pages register"
|
||||
}
|
||||
|
||||
@ -65,5 +69,11 @@ gitlab_pages_startprecmd()
|
||||
fi
|
||||
}
|
||||
|
||||
gitlab_pages_startcmd()
|
||||
{
|
||||
cd ${gitlab_pages_chdir} ; \
|
||||
daemon -u ${gitlab_pages_user} -p ${pidfile} /usr/local/bin/gitlab-pages ${gitlab_pages_args} run < /dev/null >> ${gitlab_pages_logfile} 2>> ${gitlab_pages_logfile}
|
||||
}
|
||||
|
||||
extra_commands="list register"
|
||||
run_rc_command $1
|
||||
|
Loading…
Reference in New Issue
Block a user