#!/bin/sh rm -rf "${ctmp}" runsv echo $? mkdir "${ctmp}" echo '#!/bin/sh' >"${ctmp}"/run echo 'echo starting' >>"${ctmp}"/run echo 'exec sleep 14' >>"${ctmp}"/run chmod 700 "${ctmp}"/run runsv "${ctmp}" & sleep 1 test -r "${ctmp}"/supervise/stat || sleep 2 cat "${ctmp}"/supervise/stat echo x >"${ctmp}"/supervise/control wait echo $? mkdir "${ctmp}"/log echo '#!/bin/sh' >"${ctmp}"/log/run echo 'exec cat >foo' >>"${ctmp}"/log/run chmod 700 "${ctmp}"/log/run runsv "${ctmp}" & sleep 1 test -r "${ctmp}"/log/supervise/stat || sleep 2 echo x >"${ctmp}"/supervise/control wait echo $? cat "${ctmp}"/log/foo rm -rf "${ctmp}"/supervise rm -rf "${ctmp}"/log/supervise rm -f "${ctmp}"/log/foo ln -s foo "${ctmp}"/supervise ln -s bar "${ctmp}"/log/supervise runsv "${ctmp}" & sleep 1 test -r "${ctmp}"/supervise/stat || sleep 2 test -r "${ctmp}"/log/supervise/stat || sleep 2 echo x >"${ctmp}"/foo/control wait echo $? cat "${ctmp}"/log/foo rm -rf "${ctmp}"