Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run at startup

Status
Not open for further replies.

saitan

Technical User
Jan 31, 2002
11
0
0
DE
I have a audio-server (shoutcast) and want to run it at startup.
What do I have to do?
 
Write a script & put it in /etc/init.d (see other scripts there for examples - the script should accept a parameter of start and stop).
NB: ensure it has execute permissions!

Then, link this to /etc/rc3.d so that it starts when you go to init level 3 (usual place for network-type stuff)

eg:
ln -s /etc/init.d/shoutcast /etc/rc3.d/S99shoutcast
ln -s /etc/init.d/shoutcast /etc/rc3.d/K99shoutcast

(assuming your script is called shoutcast)
Choose a numerical value (S99/K99) so that your script is run at the appropriate point (startups are procesed in numerical order).

HTH One by one, the penguins steal my sanity. X-)

 
i've already tried something like this... the problem is that the server has a output on the screen that is updated every second and so the system stops there.
I had to log in in the single-user-mode to remove the file...

but I will try it again... :)
 
OK - 1st, make sure you can run /etc/init.d/shoutcast start OK from the command line (i.e., that it runs & returns to the prompt).

Then, how about re-directing the output to a log file instead of the console? One by one, the penguins steal my sanity. X-)

 
yes, the file runs but it doesn't retun to the prompt!
i've tried it to send the output to a file, but the file is updated every second, too.

an output example:

*******************************************************************************
** SHOUTcast Distributed Network Audio Server
** Copyright (C) 1998-2000 Nullsoft, Inc. All Rights Reserved.
** Use "sc_serv filename.ini" to specify an ini file.
*******************************************************************************

Event log:
<01/31/02@19:27:36> [SHOUTcast] DNAS/SolarisSparc v1.8.3 (Aug 7 2001) starting up...
<01/31/02@19:27:36> [main] pid: 660
<01/31/02@19:27:36> [main] loaded config from sc_serv.conf
<01/31/02@19:27:36> [main] initializing (usermax:32 portbase:7777)...
<01/31/02@19:27:36> [main] No ban file found (sc_serv.ban)
<01/31/02@19:27:36> [main] No rip file found (sc_serv.rip)
<01/31/02@19:27:36> [main] opening source socket
<01/31/02@19:27:36> [main] source thread starting
<01/31/02@19:27:36> [main] opening client socket
<01/31/02@19:27:36> [main] Client Stream thread [0] starting
<01/31/02@19:27:36> [main] client main thread starting
<01/31/02@19:27:36> [source] listening for connection on port 7778
<01/31/02@19:27:36> [main] SIGWINCH; Reloaded Config File
<01/31/02@19:27:59> [sleeping] 0 listeners (0 unique)
 
Well, having had a quick look at the Shoutcast FAQ, it looks like it's intended to write to the console all the time - with an optional log file as well.

So, in your startup script, have you got something like this :-

/path/shoutcast options > /path/shoutcast.log 2>&1

???

This should stop it writing to the console & should(!) let the script finish & return you to the prompt.

If this works & you then want to see the shoutcast messages on your screen, just run tail -f /path/shoutcast.log One by one, the penguins steal my sanity. X-)

 
this is the startupscript: (it runs and there are no messages on the screen, but it don't returns to the prompt :-( )

#!/sbin/sh
#
# shoutcast-server
#
#
#ident &quot;@(#)shoutcst&quot;

case &quot;$1&quot; in
'start')

cd /download/shoutcast-1-8-3-solaris-sparc/
./sc_serv > test.txt 2>&1
;;

'stop')
echo &quot;nicht möglich&quot;
;;

*)
echo &quot;Usage: $0 { start | stop }&quot;
;;
esac
exit 0

 
Looks OK to me - sorry I can't add any more :-(

Hopefully someone else will pick this one up now - I'm off home :)

TTFN One by one, the penguins steal my sanity. X-)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top