Codes for Restarting Services

Steamcast is a stand alone server that combines the features of SHOUTcast and Icecast2 and more to make one mega awesome server.
Post Reply
boston
Posts: 6
Joined: Sun Apr 03, 2005 8:20 pm

Codes for Restarting Services

Post by boston »

Hello,

I was wondering what commands you time in to perform services in steamcast, such as reloading the playing, deleting the logs, etc.

Thanks,

Boston-
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

to flush log files use SIGHUP
to kill the server use SIGTERM or SIGINT

in the next version
SIGWINCH can be utilized to rehash your configuration files.
- Jay
boston
Posts: 6
Joined: Sun Apr 03, 2005 8:20 pm

Post by boston »

Thanks for the commands Jay.

I entered them into the command promot, however they seem not to be working.. Is there something special that i need to do?

Thanks;

Boston
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

What exactly did you enter on your command line?
garythegeek18
Posts: 5
Joined: Wed Jun 01, 2005 2:57 pm

Post by garythegeek18 »

I tried the "SIGUSR1" command two ways (improperly I guess)

a:
[root@plain nsv]# SIGUSR1
-bash: SIGUSR1: command not found
[root@plain nsv]#

b:

[root@plain nsv]# ./sc_nsv SIGUSR1
/**************************************************/
/** SHOUTcast NSV Source v1.0.0/posix
/** Written by: Jay Krivanek
/** www.radiotoolbox.com/sc_nsv/
/**************************************************/

WARNING: configuaration file could not be loaded, assuming defaults
Source Program Started...
pid: 5482
Loading Playlist playlist.plo
Playlist is in object mode
Warning: 'current' in clock not defined, ignoring.
Warning: 'classic' in clock not defined, ignoring.
Loaded 4 Objects
currents: 21 items
recurrents: 44 items
clock: 7 items
Connecting to 127.0.0.1:8000
Error: Could not bind to port.
[root@plain nsv]#
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

SIGHUP isn't a command itself, but rather just an argument in another command. You typicall use kill to either kill a process, or otherwise interrupt it and have it do something like reload a conf file and continue.

Typical syntax for a SIGHUP is as follows (Jay can elaborate or correct if I'm wrong. I haven't found this info in his docs.):

# kill -HUP pid#

substitute pid# with the process number of your steamcast. The above will flush the log files according to Jay.

You can find out the pid# by either reading the file that stores the pid according to your conf file, or by doing something like this:

# ps ax | grep steamcast
garythegeek18
Posts: 5
Joined: Wed Jun 01, 2005 2:57 pm

Post by garythegeek18 »

I will try that in a few minutes. It should definately be included in the documentation.
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

It might be in the docs, I just haven't looked to see.
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

well I assume you know how to use unix in my docs, otherwise I would be writing docs for all sorts of different platforms.

As an fyi if you don't want to bother finding your pid and you only have the one server on your system do:

killall -s SIGHUP steamcast
- Jay
Post Reply