__runit_service: move logs out of etc #27
1 changed files with 13 additions and 6 deletions
|
@ -33,18 +33,25 @@ if [ "${state}" != "present" ]; then
|
|||
exit
|
||||
fi
|
||||
|
||||
# Setup run file
|
||||
__file --state "${state}" --mode 0550 --source "${source}" \
|
||||
--onchange "sv restart '${sv}' || true" \
|
||||
"${run_file}"
|
||||
export require="${require} __file${run_file}"
|
||||
|
||||
if [ -f "${__object}/parameter/log" ]; then
|
||||
# Setup logger if requested
|
||||
__directory --parents "${svdir}/${sv}/log/main"
|
||||
export require="${require} __directory${svdir}/${sv}/log/main"
|
||||
logdir="/var/log/runit"
|
||||
__directory --parents "${svdir}/${sv}/log"
|
||||
__directory --state absent "${svdir}/${sv}/log/main" # Remove lingering old fashioned log
|
||||
__directory --parents "${logdir}/${sv}"
|
||||
export require="${require} __directory${svdir}/${sv}/log __directory${logdir}/${sv}"
|
||||
__file "${svdir}/${sv}/log/run" \
|
||||
--state "${state}" \
|
||||
--mode 0755 \
|
||||
--onchange "sv restart '${sv}/log' || true" \
|
||||
--source "-" <<EOF
|
||||
#!/bin/sh
|
||||
exec svlogd -tt ./main
|
||||
exec svlogd -tt '${logdir}/${sv}'
|
||||
EOF
|
||||
fi
|
||||
|
||||
# Setup run file
|
||||
__file --state "${state}" --mode 0755 --source "${source}" "${run_file}"
|
||||
|
|
Loading…
Reference in a new issue