Zombies left when backgrounded jobs run for longer than until the main script execs away

Bug #1790571 reported by Thorsten Glaser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mksh
Confirmed
Low
Unassigned

Bug Description

The following construct causes a zombie to hang around:

#!/bin/sh
cd /home/tglase/Misc/vpn.w
(sleep 20; sudo route -n add -host x.x.x.x gw 172.28.0.1) &
exec sudo openvpn --config /home/tglase/Misc/vpn.w/vpn-bn-01.ovpn "$@"

Adding an “exec” before the sudo in the subshell fixes this, so perhaps the shell could clean this up itself? (Ideas and patches welcome…)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.