30 lines
730 B
Plaintext
30 lines
730 B
Plaintext
#!/sbin/openrc-run
|
|
|
|
name="$RC_SVCNAME"
|
|
directory="/opt/fs-quiz-tool"
|
|
command="/opt/fs-quiz-tool/.venv/bin/python"
|
|
command_args="-m fs-quiz-tool-db"
|
|
command_user="www"
|
|
pidfile="/run/$RC_SVCNAME/$RC_SVCNAME.pid"
|
|
command_background="yes"
|
|
|
|
depend() {
|
|
need net
|
|
}
|
|
|
|
start_pre() {
|
|
checkpath --directory --owner $command_user:$command_user --mode 0775 \
|
|
/run/$RC_SVCNAME /var/log/$RC_SVCNAME
|
|
}
|
|
|
|
start() {
|
|
ebegin "Starting ${RC_SVCNAME}"
|
|
start-stop-daemon --start --exec ${command} \
|
|
--background --make-pidfile --pidfile ${pidfile} \
|
|
--chdir ${directory} \
|
|
--stdout /var/log/fs-quiz-tool/out.log \
|
|
--stderr /var/log/fs-quiz-tool/err.log \
|
|
-- ${command_args}
|
|
eend $?
|
|
}
|