PDA

View Full Version : sc_trans : sending command signals


willms_jay
23rd May 2003, 02:28
; HUP - flush logfiles (close and reopen) -- will make console logging stop
; WINCH - jump to next song
; USR1 - reload playlist off disk (will not interrupt current playing stream)
; USR2 - toggle shuffle on/off
; TERM - normal sc_trans shutdown (clean)

How do I use these given a URL?

Also, is there perhaps a PHP webtool to send these signals for you?

..thankx

..jordan

Tom
23rd May 2003, 03:31
You can't really use them through a URL, you need to use a command prompt.
For example telnet/ssh into the system and type: kill -WINCH pid

You can write a PHP script that would send a command to the system. See the PHP functions system(), exec(), etc.

Tom

willms_jay
23rd May 2003, 06:25
but how do you get the PID through PHP?

is there anyway to go about doing this?

..jordan willms

Jay
23rd May 2003, 06:51
you pull the pid from the generated log, that's how I do it.

willms_jay
23rd May 2003, 06:53
is there anyway you can share some code? I'm sorry, I'm not that good with php. It would be greatly appretiated.

thankx in advance!

jordan

willms_jay
24th May 2003, 23:09
hey dude, how do you do this?

I mean, the log has multiple start and stops of the program's output, how do you find the last PID?

..jordan willms

Jay
24th May 2003, 23:34
what you do is open the log then seek to the end of the file and travel up it until you find the first pid. Not elegant but it works.

willms_jay
25th May 2003, 04:47
the first of the file?

or the last of the file?

..jordan willms

matt2kjones
25th May 2003, 10:34
u need the last pid recorded.

best way to do that is to open the file in an editor.

set the editor to search from the "END" of the document upwards.

set it to search for "pid"

that will find the pid number for you :)

Yankeebass
2nd June 2003, 12:59
Hi,

Just follow this link (http://www.guessstation.com/playlist.php) to my site.
You can edit/upload/skip song etc. by php driven pages.

Let me know if my scripting is somewhat you're looking for?
I can get you a customized sample if needed.

Henk

DjDevin247
3rd June 2003, 20:07
Well you don't need the PID if you are only running one shoutcast transmitter - just send a "killall sc_trans_linux -WINCH" or -USR1 whatever, it will work.

DjDevin247
3rd June 2003, 20:07
I'll post some code up in a little while if you want...

Yankeebass
3rd June 2003, 20:45
Originally posted by DjDevin247
Well you don't need the PID if you are only running one shoutcast transmitter - just send a "killall sc_trans_linux -WINCH" or -USR1 whatever, it will work.

Thanks, a good command i didn't know of.
Any coding you would like to share is welcome.

Henk

tftd
12th June 2008, 22:20
Hey,
If you're still interested in the php script for sc_trans_linux I can post one script ?