From f2be17be00d6303baec04b1f88eeaaa2cafdf580 Mon Sep 17 00:00:00 2001 From: KronoZed Date: Mon, 31 Oct 2016 15:04:52 +0300 Subject: [PATCH] Create gogs.initd --- www-apps/gogs/files/gogs.initd | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 www-apps/gogs/files/gogs.initd diff --git a/www-apps/gogs/files/gogs.initd b/www-apps/gogs/files/gogs.initd new file mode 100644 index 0000000..dafda29 --- /dev/null +++ b/www-apps/gogs/files/gogs.initd @@ -0,0 +1,33 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +runas=${runas:-gogs} +pidfile=${pidfile:-/var/run/gogs.pid} +work_dir=${work_dir:-/var/lib/gogs} +custom_dir=${custom_dir:-${work_dir}/custom} + +depend() { + use net + after dns +} + +start() { + ebegin "Starting Gogs: Go Git Service" + checkpath -d -m 0755 -o ${runas}:${runas} /var/lib/${runas} + start-stop-daemon --background --start --quiet \ + --pidfile ${pidfile} --make-pidfile \ + --user ${runas} --chdir ${work_dir} \ + --exec env GOGS_WORK_DIR=${work_dir} \ + GOGS_CUSTOM=${custom_dir} /usr/bin/gogs \ + -- web + eend $? +} + +stop() { + ebegin "Stopping Gogs: Go Git Service" + start-stop-daemon --stop --quiet --exec /usr/bin/gogs \ + --pidfile ${pidfile} --name ${runas} + eend $? +}