32 lines
746 B
Plaintext
32 lines
746 B
Plaintext
|
#! /sbin/openrc-run
|
||
|
|
||
|
supervisor=supervise-daemon
|
||
|
|
||
|
name="darkhttpd web server"
|
||
|
description="Simple, single-threaded, static content webserver"
|
||
|
|
||
|
command="/usr/bin/darkhttpd"
|
||
|
command_args="${document_root:-/var/www/localhost/htdocs} ${darkhttpd_args}"
|
||
|
|
||
|
optional_arg() {
|
||
|
if [ -n "$2" ]; then
|
||
|
command_args="$command_args $1 $2"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
start_pre() {
|
||
|
if [ -n "$logdir" ]; then
|
||
|
checkpath --directory --owner darkhttpd "${logdir}"
|
||
|
command_args="$command_args --log ${logdir}/access.log"
|
||
|
fi
|
||
|
optional_arg --addr "$addr"
|
||
|
optional_arg --port "$port"
|
||
|
optional_arg --uid "$run_as_user"
|
||
|
optional_arg --gid "$run_as_group"
|
||
|
optional_arg --mimetypes "$mimetypes"
|
||
|
if yesno "${run_in_chroot:-no}"; then
|
||
|
command_args="${command_args} --chroot"
|
||
|
fi
|
||
|
}
|
||
|
|