I wrote a small Python GUI that allows users to play Internet radio channels. The program uses the Python () subprocess to initialize mplayer to tune to the pipe, for example:
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 it saves p.pid, and when the user wants to stop listening, the following code is used:
os.kill(p.pid, 9)
This works fine in OpenSUSE, but not in Ubuntu. Ubuntu seems to actually be launching two separate processes. Terminal output:
Opensuse 11.3:
$ pgrep mplayer
22845
Ubuntu 10.04:
$ pgrep mplayer
22846
22847
This also applies when starting other programs. Does anyone know why? I really want this application to run on all distributions, so any help is greatly appreciated.
frigg