Comment 1 for bug 538642

Revision history for this message
jwm (jwm-angrymonkey) wrote :

This seems to do the job:

trap exit CHLD
env - PATH=$PATH svscan /etc/service 2>&1 | \
readproctitle service errors: .................................................\
...............................................................................\
...............................................................................\
...............................................................................\
...............................................................................\
................................... &
wait

The trap will exit if *any* child process exits for any reason, but the command needs to be backgrounded for a signal to bubble up.

Now, if the primary svscan process dies, svscanboot will exit and be restarted. This is also the case if the readproctitle process dies, but that's desirable, too.

Can someone with more shell clues check this over?