diff --git a/www/gitlab-pages/Makefile b/www/gitlab-pages/Makefile index f96793504e3b..8f6db43db9bf 100644 --- a/www/gitlab-pages/Makefile +++ b/www/gitlab-pages/Makefile @@ -2,6 +2,7 @@ PORTNAME= gitlab-pages PORTVERSION= 0.7.1 +PORTREVISION= 1 CATEGORIES= www MAINTAINER= swills@FreeBSD.org diff --git a/www/gitlab-pages/files/gitlab_pages.in b/www/gitlab-pages/files/gitlab_pages.in index 78eb1fe36779..2c894bf73119 100644 --- a/www/gitlab-pages/files/gitlab_pages.in +++ b/www/gitlab-pages/files/gitlab_pages.in @@ -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