This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools.pxe-share: run dnsmasq in the background so ctrl+c works

+12 -1
+12 -1
tools/pxe-share/pxe-share.sh
··· 280 280 fi 281 281 282 282 echo "$PROG: press Ctrl+C to stop" 283 - dnsmasq "${DNSMASQ_OPTS[@]}" 283 + 284 + # dnsmasq must not be a foreground child: a trap set while bash blocks on an 285 + # external command is deferred until that command returns, and sudo runs us in 286 + # its own pty/process group so the terminal's SIGINT never reaches dnsmasq 287 + # either. The result was a Ctrl+C that did nothing at all. Backgrounding it and 288 + # blocking in `wait` (a builtin, so handlers run immediately) means the signal 289 + # is forwarded on, dnsmasq exits, and the EXIT trap tears down the firewall 290 + # rules and darkhttpd. 291 + dnsmasq "${DNSMASQ_OPTS[@]}" & 292 + DNSMASQ_PID=$! 293 + trap 'kill -TERM "$DNSMASQ_PID" 2>/dev/null' INT TERM 294 + wait "$DNSMASQ_PID"