EAC Linux v2 on Gentoo with OpenRC: ebuilds, host config, tools, docs
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#!/sbin/openrc-run
|
||||
# Instances: socket-activate.NAME -> socket-activate, settings in conf.d/socket-activate.NAME.
|
||||
|
||||
description="Starts a service when a client connects to its socket (systemd socket activation)"
|
||||
supervisor=supervise-daemon
|
||||
command=/usr/libexec/eac-openrc-compat/socket-activate
|
||||
command_args="${socket_type:-stream} ${socket_address} ${socket_command}"
|
||||
[ "${socket_nonblocking}" = yes ] && command_args="-n ${command_args}"
|
||||
output_log="/var/log/${RC_SVCNAME}.log"
|
||||
error_log="/var/log/${RC_SVCNAME}.log"
|
||||
retry="TERM/15/KILL/5"
|
||||
respawn_max=5
|
||||
respawn_period=60
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ "${RC_SVCNAME}" = socket-activate ]; then
|
||||
eerror "Start an instance: socket-activate.NAME"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -x "${socket_command%% *}" ]; then
|
||||
eerror "${socket_command%% *} is not installed"
|
||||
return 1
|
||||
fi
|
||||
for kv in ${socket_env}; do
|
||||
export "${kv}"
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user