prain stack: requires_NAME refuses to start without its services, merged --help
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# Order only: in a runlevel with both, web starts after vLLM is ready. Starting web alone
|
||||
# never starts vLLM; requires_web in prain.conf makes it fail with a message instead.
|
||||
rc_after="prain.vllm"
|
||||
+4
-6
@@ -1,7 +1,8 @@
|
||||
#!/sbin/openrc-run
|
||||
# One service of the prain stack, picked by the link name: prain.vllm, prain.web, ...
|
||||
# What it runs comes from prain.conf (`prain run NAME`); supervision settings from
|
||||
# conf.d/prain.NAME (respawn_max, respawn_period, respawn_delay).
|
||||
# What it runs and what must already run come from prain.conf (`prain run NAME`,
|
||||
# `prain deps NAME`); supervision settings and start order from conf.d/prain.NAME
|
||||
# (respawn_max, respawn_period, respawn_delay, rc_after).
|
||||
|
||||
stack_name=${RC_SVCNAME#prain.}
|
||||
description="prain stack: ${stack_name}"
|
||||
@@ -14,16 +15,13 @@ respawn_period=${respawn_period:-600}
|
||||
output_log=${XDG_STATE_HOME:-$HOME/.local/state}/prain/${stack_name}.log
|
||||
error_log=${output_log}
|
||||
|
||||
depend() {
|
||||
need $("${prain_bin:-$HOME/.local/bin/prain}" need "${RC_SVCNAME#prain.}")
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ "${RC_SVCNAME}" = prain ]; then
|
||||
eerror "Start a link to this script, like prain.vllm"
|
||||
return 1
|
||||
fi
|
||||
checkpath -d "${output_log%/*}"
|
||||
"${command}" deps "${stack_name}" # requires_NAME in prain.conf: refuse, never start them
|
||||
}
|
||||
|
||||
start_post() {
|
||||
|
||||
Reference in New Issue
Block a user