archives/gitaly: new aport
This commit is contained in:
parent
4f090a8ad5
commit
6496493030
3 changed files with 216 additions and 0 deletions
39
archives/gitaly/gitaly.initd
Normal file
39
archives/gitaly/gitaly.initd
Normal file
|
@ -0,0 +1,39 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
name="Gitaly"
|
||||
description="A Git RPC service for handling all the git calls made by GitLab"
|
||||
|
||||
: ${gitaly_config:="/etc/gitlab/gitaly.toml"}
|
||||
: ${gitaly_logfile:="/var/log/gitlab/gitaly.log"}
|
||||
|
||||
command="/usr/bin/gitaly"
|
||||
command_args="$gitaly_config"
|
||||
command_background="yes"
|
||||
command_user="git"
|
||||
|
||||
output_log="$gitaly_logfile"
|
||||
error_log="$gitaly_logfile"
|
||||
pidfile="/run/gitaly.pid"
|
||||
supervise_daemon_args="--env TZ=:/etc/localtime"
|
||||
start_stop_daemon_args="$supervise_daemon_args"
|
||||
|
||||
rc_ulimit="-n 15000"
|
||||
|
||||
required_files="$gitaly_config"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
local socket_path=$(sed -En "s/^\s*socket_path\s*=\s*[\"']([^\"']+)[\"']/\1/p" "$gitaly_config")
|
||||
local runtime_dir=$(sed -En "s/^\s*runtime_dir\s*=\s*[\"']([^\"']+)[\"']/\1/p" "$gitaly_config")
|
||||
|
||||
if [ "$socket_path" ]; then
|
||||
checkpath -q -d -m 755 -o $command_user "${socket_path%/*}" || return 1
|
||||
fi
|
||||
if [ "$runtime_dir" ]; then
|
||||
checkpath -q -d -m 750 -o $command_user "$runtime_dir" || return 1
|
||||
fi
|
||||
checkpath -f -m 640 -o $command_user "$gitaly_logfile"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue