__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
|
exit
|
||||||
fi
|
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
|
if [ -f "${__object}/parameter/log" ]; then
|
||||||
# Setup logger if requested
|
# Setup logger if requested
|
||||||
__directory --parents "${svdir}/${sv}/log/main"
|
logdir="/var/log/runit"
|
||||||
export require="${require} __directory${svdir}/${sv}/log/main"
|
__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" \
|
__file "${svdir}/${sv}/log/run" \
|
||||||
--state "${state}" \
|
--state "${state}" \
|
||||||
--mode 0755 \
|
--mode 0755 \
|
||||||
|
--onchange "sv restart '${sv}/log' || true" \
|
||||||
--source "-" <<EOF
|
--source "-" <<EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec svlogd -tt ./main
|
exec svlogd -tt '${logdir}/${sv}'
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup run file
|
|
||||||
__file --state "${state}" --mode 0755 --source "${source}" "${run_file}"
|
|
||||||
|
|
Loading…
Reference in a new issue