bash - Shell script: How to restart a process (with pipe) if it dies -
i use technique described in how write bash script restart process if dies? lhunath in order restart dead process.
until myserver; echo "server 'myserver' crashed exit code $?. respawning.." >&2 sleep 1 done
but rather invoking process myserver, invoke such thing:
myserver 2>&1 | /usr/bin/logger -p local0.info &
how use first technique process pipe?
the until
loop can piped logger
:
until myserver 2>&1; echo "..." sleep 1 done | /usr/bin/logger -p local0.info &
since myserver
inherits standard output , error loop (which inherits shell).
Comments
Post a Comment