summaryrefslogtreecommitdiff
path: root/www/gitlab-pages/files
diff options
context:
space:
mode:
authorMatthias Fechner <mfechner@FreeBSD.org>2018-04-06 16:27:27 +0000
committerMatthias Fechner <mfechner@FreeBSD.org>2018-04-06 16:27:27 +0000
commit076bb65ad88d33eb131b503ebe01f7f783647a90 (patch)
tree7120494b1fe56b12e77c10f9870b05fc04c1a06b /www/gitlab-pages/files
parentUpdate to 1.0.2 (diff)
New ports required for gitlab update to 10.5.x.
Submitted by: swills Reviewed by: mat, swills (mentor) Approved by: swills (mentor) Differential Revision: https://reviews.freebsd.org/D14841
Notes
Notes: svn path=/head/; revision=466666
Diffstat (limited to 'www/gitlab-pages/files')
-rw-r--r--www/gitlab-pages/files/gitlab_pages.in69
1 files changed, 69 insertions, 0 deletions
diff --git a/www/gitlab-pages/files/gitlab_pages.in b/www/gitlab-pages/files/gitlab_pages.in
new file mode 100644
index 000000000000..78eb1fe36779
--- /dev/null
+++ b/www/gitlab-pages/files/gitlab_pages.in
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: gitlab_pages
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable gitlab_pages:
+#
+# gitlab_pages_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable gitlab-pages
+# gitlab_pages_dir (str): Set to "/var/tmp/gitlab_pages" by default.
+# Set it to directory to run gitlab-pages in
+# gitlab_pages_user (str): Set to "gitlab-pages" by default.
+# 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
+#
+
+. /etc/rc.subr
+
+name="gitlab_pages"
+rcvar="gitlab_pages_enable"
+
+load_rc_config $name
+
+: ${gitlab_pages_enable:="NO"}
+: ${gitlab_pages_dir:="/var/tmp/gitlab_pages"}
+: ${gitlab_pages_user:="gitlab-pages"}
+: ${gitlab_pages_group:="gitlab-pages"}
+
+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"
+list_cmd="listfunc"
+register_cmd="registerfunc"
+
+listfunc()
+{
+ su -m ${gitlab_pages_user} -c "env HOME=${gitlab_pages_dir} %%PREFIX%%/bin/gitlab-pages list"
+}
+
+registerfunc()
+{
+ su -m ${gitlab_pages_user} -c "env HOME=${gitlab_pages_dir} %%PREFIX%%/bin/gitlab-pages register"
+}
+
+gitlab_pages_startprecmd()
+{
+ if [ ! -e "${pidfile}" ]; then
+ install -g ${gitlab_pages_group} -o ${gitlab_pages_user} -- /dev/null "${pidfile}";
+ fi
+ if [ ! -d "${gitlab_pages_dir}" ]; then
+ install -d -o "${gitlab_pages_user}" -g "${gitlab_pages_group}" "${gitlab_pages_dir}"
+ fi
+}
+
+extra_commands="list register"
+run_rc_command $1