aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLauris BH2022-10-16 00:59:52 +0300
committerGitHub2022-10-15 17:59:52 -0400
commit8e8b536c293a44c5b3c9f7f504be3327012f1434 (patch)
tree772a7e30c8918c5d3030d142ebb538f471920eb8 /contrib
parentbc532563169b14cf6e51db6ca7190289fd81c0f1 (diff)
Update OpenRC startup script (#21436)
Diffstat (limited to 'contrib')
-rw-r--r--contrib/init/gentoo/gitea37
1 files changed, 33 insertions, 4 deletions
diff --git a/contrib/init/gentoo/gitea b/contrib/init/gentoo/gitea
index e423eae54..db904e7bb 100644
--- a/contrib/init/gentoo/gitea
+++ b/contrib/init/gentoo/gitea
@@ -2,14 +2,43 @@
DIR=/var/lib/gitea
USER=git
+HOME=/home/${USER}
+GITEA_WORK_DIR=${DIR}
+EXECUTABLE=/usr/local/bin/gitea
+export USER
+export HOME
+export GITEA_WORK_DIR
+
+name=$RC_SVCNAME
+cfgfile="/etc/$RC_SVCNAME/app.ini"
+command="${EXECUTABLE}"
+command_user="${USER}"
+command_args="web -c /etc/$RC_SVCNAME/app.ini"
+command_background="yes"
+pidfile="/run/$RC_SVCNAME/$RC_SVCNAME.pid"
start_stop_daemon_args="--user ${USER} --chdir ${DIR}"
-command="/usr/local/bin/gitea"
-command_args="web -c /etc/gitea/app.ini"
-command_background=yes
-pidfile=/run/gitea.pid
depend()
{
need net
+ ###
+ # Don't forget to add the database service requirements
+ ###
+ #after postgresql
+ #after mysql
+ #after mariadb
+ #after memcached
+ #after redis
+}
+
+start_pre()
+{
+ checkpath --directory --owner $command_user:$command_user --mode 0750 \
+ /run/$RC_SVCNAME /var/log/$RC_SVCNAME
+ ##
+ # If you want to bind Gitea to a port below 1024, uncomment
+ # the value below
+ ##
+ #setcap cap_net_bind_service=+ep "${EXECUTABLE}"
}