aboutsummaryrefslogtreecommitdiff
path: root/www/gitlab-pages
diff options
context:
space:
mode:
authorSteve Wills <swills@FreeBSD.org>2018-04-24 01:01:37 +0000
committerSteve Wills <swills@FreeBSD.org>2018-04-24 01:01:37 +0000
commitf8eebf705dda002e2328e23292227c9992ed2d0d (patch)
tree4134ec8aece2f568d1d90cc6141edd4aa1c87470 /www/gitlab-pages
parentcf81b6a93b423f4e6c85b381e5926174eb7c3863 (diff)
downloadports-f8eebf705dda002e2328e23292227c9992ed2d0d.tar.gz
ports-f8eebf705dda002e2328e23292227c9992ed2d0d.zip
www/gitlab-pages: fix rc script
Notes
Notes: svn path=/head/; revision=468171
Diffstat (limited to 'www/gitlab-pages')
-rw-r--r--www/gitlab-pages/Makefile1
-rw-r--r--www/gitlab-pages/files/gitlab_pages.in14
2 files changed, 13 insertions, 2 deletions
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