29 lines
826 B
Plaintext
Executable File
29 lines
826 B
Plaintext
Executable File
#!/sbin/openrc-run
|
|
|
|
description="LavinMQ message queue service"
|
|
|
|
command="/usr/bin/lavinmq"
|
|
command_user="${LAVINMQ_USER:-lavinmq}:${LAVINMQ_GROUP:-lavinmq}"
|
|
command_background="yes"
|
|
pidfile="/run/lavinmq/lavinmq.pid"
|
|
output_log="${LAVINMQ_LOG:-/var/log/lavinmq/lavinmq.log}"
|
|
error_log="${LAVINMQ_ERRLOG:-/var/log/lavinmq/lavinmq.log}"
|
|
|
|
config_file="${LAVINMQ_CONFIG:-/etc/lavinmq/lavinmq.ini}"
|
|
data_dir="${LAVINMQ_DATA_DIR:-/var/lib/lavinmq}"
|
|
command_args="-D ${data_dir} --config ${config_file} ${LAVINMQ_OPTS:-}"
|
|
|
|
depend() {
|
|
need net
|
|
}
|
|
|
|
start_pre() {
|
|
local service_owner="${LAVINMQ_USER:-lavinmq}:${LAVINMQ_GROUP:-lavinmq}"
|
|
|
|
checkpath -d -m 0755 -o "$service_owner" \
|
|
/run/lavinmq \
|
|
/var/log/lavinmq
|
|
checkpath -d -m 0750 -o "$service_owner" "$data_dir"
|
|
checkpath -f -m 0640 -o "$service_owner" "$data_dir"/.lock
|
|
}
|