Files
alpine-packages/packaging/alpine/local/greptimedb/greptimedb.initd
T
fspjo e8333709a5
Build Alpine Packages / preflight (push) Successful in 12s
Build Alpine Packages / build (gitea) (push) Successful in 21s
Build Alpine Packages / build (lavinmq) (push) Successful in 2m54s
Build Alpine Packages / build (seaweedfs) (push) Successful in 20m49s
Build Alpine Packages / build (greptimedb) (push) Successful in 1h42m55s
Build Alpine Packages / verify-and-publish (push) Failing after 1m26s
Parallel Builds (#10)
Reviewed-on: #10
2026-09-29 07:17:00 +02:00

63 lines
1.7 KiB
Plaintext
Executable File

#!/sbin/openrc-run
service_name="${RC_SVCNAME#greptimedb.}"
description="GreptimeDB ${service_name} service"
command="/usr/bin/greptime"
command_user="${GREPTIMEDB_USER:-greptimedb}:${GREPTIMEDB_GROUP:-greptimedb}"
command_background="yes"
retry="TERM/30/KILL/5"
pidfile="/run/greptimedb/${RC_SVCNAME}.pid"
output_log="${GREPTIMEDB_LOG:-/var/log/greptimedb/${RC_SVCNAME}.log}"
error_log="${GREPTIMEDB_ERRLOG:-/var/log/greptimedb/${RC_SVCNAME}.log}"
build_command_args() {
config_file="${GREPTIMEDB_CONFIG:-/etc/greptimedb/${service_name}.toml}"
log_dir="${GREPTIMEDB_LOG_DIR:-/var/log/greptimedb/${service_name}}"
data_home="${GREPTIMEDB_DATA_HOME:-/var/lib/greptimedb/${service_name}}"
wal_dir="${GREPTIMEDB_WAL_DIR:-/var/lib/greptimedb/${service_name}/wal}"
command_args="${GREPTIMEDB_GLOBAL_OPTS:-} ${service_name} start -c ${config_file} --log-dir ${log_dir}"
case "$service_name" in
datanode)
command_args="$command_args --data-home ${data_home} --wal-dir ${wal_dir}"
;;
metasrv|standalone)
command_args="$command_args --data-home ${data_home}"
;;
esac
command_args="$command_args ${GREPTIMEDB_OPTS:-}"
}
build_command_args
depend() {
need net
case "$service_name" in
datanode|flownode|frontend)
after greptimedb.metasrv
;;
esac
}
start_pre() {
checkpath -d -m 0755 -o "${GREPTIMEDB_USER:-greptimedb}:${GREPTIMEDB_GROUP:-greptimedb}" \
/run/greptimedb \
/var/log/greptimedb \
/var/lib/greptimedb \
"$log_dir"
case "$service_name" in
datanode)
checkpath -d -m 0750 -o "${GREPTIMEDB_USER:-greptimedb}:${GREPTIMEDB_GROUP:-greptimedb}" \
"$data_home" "$wal_dir"
;;
metasrv|standalone)
checkpath -d -m 0750 -o "${GREPTIMEDB_USER:-greptimedb}:${GREPTIMEDB_GROUP:-greptimedb}" \
"$data_home"
;;
esac
}