PDA

View Full Version : Getting PID of shoutcast daemon


pillhead
3rd January 2005, 23:01
Hi, I cant seem to get the PID of the last launched shoutcast instance by using the normal "sc_serv & echo $!" method.

Is there any other way of obtaining the PID of the last launched daemon? I need to make a startup/shutdown script to kill the server when it shutsdown.

fcchelsea
5th January 2005, 16:13
ps -ax | grep $configfile | grep -v grep | awk '{print $1}'

This is what i call from a php file, $configfile is the name of the config file.

pillhead
11th January 2005, 21:35
AHh, I see, not a bad idea, would just have alter my start script so that it runs sc_serv sc_serv.conf instead of just sc_serv and that would work :)