1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 03:05:48 +03:00
aports/community/atuin/atuin.initd
2022-11-19 00:25:34 +00:00

32 lines
725 B
Bash

#!/sbin/openrc-run
description="Sync server for shell history"
: ${command_user:="atuin:atuin"}
: ${output_log="/var/log/atuin-server.log"}
: ${error_log="/var/log/atuin-server.log"}
: ${cfgdir:="/etc/atuin"}
: ${loglevel:="WARN"}
command="/usr/bin/atuin-server"
command_args="server start $command_args"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
required_files="$cfgdir/server.toml"
depend() {
need net
use postgresql
}
start_pre() {
export ATUIN_CONFIG_DIR="$cfgdir"
export RUST_LOG="$loglevel"
if [ "$output_log" ]; then
checkpath -f -o "$command_user" -m 640 -q "$output_log" || return 1
fi
if [ "$error_log" ]; then
checkpath -f -o "$command_user" -m 640 -q "$error_log" || return 1
fi
}