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

Bug #1790571 reported by Thorsten Glaser on 2018-09-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mksh
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  Edit
Everyone can see this information.

Other bug subscribers