stud
stud copied to clipboard
stud.init, wrong PID when "no DH parameters found"
The init script provided by stun retrieves the daemonized process PID as follows:
out=`${prefix} ${STUD} ${opts} 2>&1`
...
stud_pid=`echo "${out}" | tail -n 1 | cut -d " " -f5 | tr -d '.'`
But depending on the provided certificate, the first line printed to stdout by the daemonized stud process is:
{core} Note: no DH parameters found in PATH_TO_CERT_FILE
and therefore the retrieved PID would be wrong (or null).
NOTE: the line {core} Note: no DH parameters found in PATH_TO_CERT_FILE is sent to stderr. However the init scripts previously does 2>&1 and therefore such a line would be redirected to the stdout and thus captured by the tail command as the first line => PID wont be retrieved.