aboutsummaryrefslogtreecommitdiffstats
path: root/community/atuin/atuin.initd
diff options
context:
space:
mode:
Diffstat (limited to 'community/atuin/atuin.initd')
-rw-r--r--community/atuin/atuin.initd32
1 files changed, 32 insertions, 0 deletions
diff --git a/community/atuin/atuin.initd b/community/atuin/atuin.initd
new file mode 100644
index 00000000000..56415c27da6
--- /dev/null
+++ b/community/atuin/atuin.initd
@@ -0,0 +1,32 @@
+#!/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
+}