#!/bin/sh
rm -rf "${ctmp}"

udpsvd
echo $?
udpsvd -V
echo $?

mkdir "${ctmp}"
udpsvd -llocalhost -i"${ctmp}" 127.0.0.1 12614 sh -c 'head -n1 >&2' &
pid=$!
sleep 1
echo "sh -c 'head -n1 >&2; echo bar >&2'" >"${ctmp}"/127.0
chmod 0755 "${ctmp}"/127.0
check-udpsvd
sleep 3
kill -TERM $pid
wait
echo $?
rm -rf "${ctmp}"
