On Wed, Aug 22, 2018 at 08:31:43PM +0300, Andrei Otcheretianski wrote: > The ./start.sh script spawns hostapd process using "sudo". > Since sudo forks a child process, $! holds the pid of sudo itself. > Fix that by storing the PID of the child process instead. > diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh > @@ -121,7 +121,10 @@ sudo $(printf -- "$VALGRIND_WPAS" 5) $WPAS -g /tmp/wpas-wlan5 -G$GROUP \ > sudo $VALGRIND_HAPD $HAPD -ddKt$TRACE -g /var/run/hostapd-global -G $GROUP -f $LOGDIR/hostapd & > HPID=$! > -echo $HPID > $LOGDIR/hostapd-test.pid > + > +# Sleep a bit, otherwise pgrep may run before the child is forked > +sleep 0.1 > +pgrep -P $HPID > $LOGDIR/hostapd-test.pid This breaks inside-VM testing where sudo is a dummy script (see tests/hwsim/inside.sh generating the sudo scripts). In addition, sudo is documented to relay signals. Could you please clarify what you are trying to fix here? That $VALGRIND_HAPD part could be a yet another program in the chain, so it might make more sense to to determine the actual hostapd PID through a new test command on the control interface to make this more robust. -- Jouni Malinen PGP id EFC895FA _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap