questd-monitor: start questd if it's not running

This commit is contained in:
Alex Oprea 2017-03-06 11:30:10 +01:00
parent 97cd7cdff8
commit 1fe2d1e87f

View file

@ -50,7 +50,7 @@ check_nproc()
{
local nproc="$@"
if [ "$nproc" -ge "$NPROC_LIMIT" ]; then
if [ "$nproc" -ge "$NPROC_LIMIT" -o "$nproc" -eq "0" ]; then
NPROC_NFAIL=$((NPROC_NFAIL + 1))
else
NPROC_NFAIL=0
@ -125,7 +125,7 @@ main()
# collect info
topline=$(top -bn1 | grep "/sbin/[q]uestd" | grep -v monitor)
nproc=$(echo "$topline" | wc -l)
nproc=$(echo -n "$topline" | awk 'END{print NR}')
check_nproc $nproc
restart_nproc=$?