there are over 30 mplayer processes on squeezebox server machine after
listen to NPR radio for a while. I am using a cron job to kill those
extra mplayer processes. Is there a better way, such as a patch to the
plugin itself?

below is the script in cron:
> #!/usr/bin/env python
> import subprocess
> 
> max_running_mplayers=5
> process = subprocess.Popen(["ps", "-u", "111"],stdout=subprocess.PIPE)
> 
> mplayer_pids=[]
> for line in process.stdout:
>     list_pid=line.split()
>     if list_pid[3]=="mplayer":
>            mplayer_pids.append(list_pid[0])
> 
> if len(mplayer_pids)>max_running_mplayers:
>     del_pids=mplayer_pids[:-4]
>     for pid in del_pids:
>        
> subprocess.call(("kill","-9",pid))
>


-- 
forceps
------------------------------------------------------------------------
forceps's Profile: http://forums.slimdevices.com/member.php?userid=44261
View this thread: http://forums.slimdevices.com/showthread.php?t=85929

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to