Prev Previous Post   Next Post Next
Old 7th July 2003, 17:07   #9
pimpalize
Junior Member
 
Join Date: May 2003
Posts: 15
i know there is probably a prettier way to do this, but here is how i kill sc_trans




PHP Code:

$command 
"ps";
$output shell_exec($command);
$pids split("\\xa"$output);


for (
$x 0$x count($pids); $x++){
        if (
strpos($pids[$x], "sc_trans") <> 0){
                
$theparts split(" "trim($pids[$x]));
                
$thetransnum $theparts[0];
                break;
        }
}

exec("kill -TERM $thetransnum"); 
now i know this just finds the first sc_trans pid and terminates it, but it seems to work since i guess the others are just child processes of that first one so are also killed, hope this helps.


on a side note i wrote a script for starting sc_trans

PHP Code:
exec("nohup ./sc_trans > /dev/null &"); 
and for some reason this will shutdown every so often and i cant figure out why. i just restart it and it works for another day or so, probably server related but any suggestions would be great
pimpalize is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump