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

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -