I've written small gui-frontend in Python that lets users play internet radio channels. The program uses Pythons subprocess() to initizalize mplayer in order to tune into a channel, e.g.:
runn = "mplayer http://77.111.88.131:8010"
p = subprocess.Popen(runn, shell=True)
pid = int(p.pid)
wait = os.waitpid(p.pid, 1)
Then saves p.pid, and when a user wants to stop listening the following code is used:
os.kill(p.pid, 9)
This works perfectly in OpenSUSE, but not in Ubuntu. It seems that Ubuntu actually starts two separate processes. Terminal output:
Opensuse 11.3:
$ pgrep mplayer
22845
Ubuntu 10.04:
$ pgrep mplayer
22846
22847
This also applies when running other programs. Does anyone know why? I really want this app to run on all distros, so any help is deeply appreciated.