2016-12-22 15:09:17 +05:30
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
2018-06-05 07:32:04 +05:30
|
|
|
DIR=/var/lib/gitea
|
2016-12-22 15:09:17 +05:30
|
|
|
USER=git
|
2022-10-16 03:29:52 +05:30
|
|
|
HOME=/home/${USER}
|
|
|
|
GITEA_WORK_DIR=${DIR}
|
|
|
|
EXECUTABLE=/usr/local/bin/gitea
|
2016-12-22 15:09:17 +05:30
|
|
|
|
2022-10-16 03:29:52 +05:30
|
|
|
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"
|
2016-12-22 15:09:17 +05:30
|
|
|
start_stop_daemon_args="--user ${USER} --chdir ${DIR}"
|
|
|
|
|
|
|
|
depend()
|
|
|
|
{
|
|
|
|
need net
|
2022-10-16 03:29:52 +05:30
|
|
|
###
|
|
|
|
# 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}"
|
2016-12-22 15:09:17 +05:30
|
|
|
}
|