[Red5] Red5 start/stop script

Dominick Accattato dominick at red5.org
Fri Oct 30 11:56:33 PST 2009


nice andy thanks for explaining

On Fri, Oct 30, 2009 at 3:37 PM, Andy Shaules <bowljoman at hotmail.com> wrote:

>  That servlet also will start up red5.
>
> Lay out 3 or 4 red5 distributions and light one up.
>
> Now in the servlet controlled red5 distribution, you will need to hard code
> some build elements possibly, its been awhile since I deployed this. Also of
> course, all distributions need well_configured red5.properties to not
> conflict.
>
> After that you can use the master red5 tomcat deployment to start and stop
> multiple red5 instances using the servlet post/get requests. If I remember
> right, you can watch the staratup output print into the servlet for as long
> as you keep it open for the proceesing servlet output thread.
>
>
>
> ----- Original Message -----
> *From:* Dominick Accattato <dominick at red5.org>
> *To:* red5 at osflash.org
> *Sent:* Friday, October 30, 2009 12:21 PM
> *Subject:* Re: [Red5] Red5 start/stop script
>
> yep, looking into that...
>
> On Fri, Oct 30, 2009 at 3:14 PM, Andy Shaules <bowljoman at hotmail.com>wrote:
>
>>  No I dont mind at all, I tried to register but your main bounced and the
>> wiki gave me error.
>>
>>  ----- Original Message -----
>> *From:* Dominick Accattato <dominick at red5.org>
>> *To:* red5 at osflash.org
>>   *Sent:* Friday, October 30, 2009 11:43 AM
>> *Subject:* Re: [Red5] Red5 start/stop script
>>
>> lots of tips and tricks and scripts here... wouldn't want them to get lost
>> in the mix.  Andy, I posted to the wiki, do you mind?
>> http://trac.red5.org/wiki/Servlets/Stopping%20Red5%20From%20a%20Servlet
>>
>> On Fri, Oct 30, 2009 at 1:06 PM, Andy Shaules <bowljoman at hotmail.com>wrote:
>>
>>> Here is a httpservlet method to stop the red5. Of course it may be wise
>>> to check for session credentials. ;)
>>>
>>> This is on windows, using .bat
>>>
>>>
>>> public void doGet(HttpServletRequest request, HttpServletResponse
>>> response) throws ServletException, IOException
>>> {
>>>
>>> final ServletOutputStream sos=response.getOutputStream();
>>> String cmd="C:/red5/trunk/dist/red5-shutdown.bat";
>>> Process ls_proc = Runtime.getRuntime().exec(cmd);
>>> final BufferedReader in = new BufferedReader(new
>>> InputStreamReader(ls_proc.getInputStream()));
>>> final BufferedReader in2 = new BufferedReader(new
>>> InputStreamReader(ls_proc.getErrorStream()));
>>> PrintWriter out = new PrintWriter(new BufferedWriter(new
>>> OutputStreamWriter(ls_proc.getOutputStream())), true);
>>>
>>> sos.println("stopping red5");
>>> Process ls_proc2 = Runtime.getRuntime().exec(cmd);
>>> new Thread( new Runnable()
>>> {
>>>   public void run()
>>>   {
>>>       try {
>>>       sos.println("Red5 output");
>>>       sos.close();
>>>       String line = "";
>>>       String line2 ="";
>>>       while ((line = in.readLine()) != null || (line2 = in2.readLine())
>>> != null) {
>>>           if(line !=null)
>>>           System.out.println(line);
>>>           if(line2 !=null)
>>>           System.out.println(line2);
>>>           System.out.close();
>>>           }
>>>           }catch(Exception e){ System.out.println("Exception"); };
>>>   }
>>> }
>>>
>>> ).run();
>>>
>>> }
>>>
>>>
>>> ----- Original Message ----- From: Jake Hilton
>>> To: red5 at osflash.org
>>> Sent: Friday, October 30, 2009 9:46 AM
>>> Subject: Re: [Red5] Red5 start/stop script
>>>
>>>
>>>
>>> Yes you could tweak that script to handle the shutdown like so:
>>>
>>>
>>> stop)
>>>       echo -n "Shutting down red5"
>>>       echo -n " "
>>>       cd $RED5_DIR
>>>       su -s /bin/bash -c "$RED5_DIR/red5-shutdown.sh &" red5
>>>       sleep 2
>>>       ;;
>>>
>>>
>>>
>>>
>>> Jake
>>>
>>>
>>> On Fri, Oct 30, 2009 at 10:07 AM, Mondain <mondain at gmail.com> wrote:
>>>
>>> If you guys are gonna use the scripts I suggest that you use
>>> red5-shutdown.sh, since this will "cleanly" shut the sever down.
>>>
>>>
>>> Paul
>>>
>>>
>>>
>>> On Fri, Oct 30, 2009 at 2:45 AM, Cristian Rusu <crirus at gmail.com> wrote:
>>>
>>> Here is my spin
>>>
>>> cd /etc/init.d/
>>> touch red5
>>> chmod 755 red5
>>> vi red5
>>>
>>> Paste below code
>>>
>>>
>>> #! /bin/sh
>>> #
>>> # Author: Jake Hilton <red5 at jakehilton.com>
>>> # /etc/init.d/red5
>>> #
>>> # Check for missing file
>>> RED5_DIR=/opt/red5
>>> test -x $RED5_DIR/red5.sh || exit 5
>>>
>>> case "$1" in
>>>   start)
>>>       echo -n "Starting Red5 Service"
>>>       echo -n " "
>>>       cd $RED5_DIR
>>>       su -s /bin/bash -c "$RED5_DIR/red5.sh &" red5
>>>       sleep 2
>>>       ;;
>>>   stop)
>>>       echo -n "Shutting down red5"
>>>       echo -n " "
>>>       su -s /bin/bash -c "killall -q -u red5 java" red5
>>>       sleep 2
>>>       ;;
>>>   restart)
>>>       ## Stop the service and regardless of whether it was
>>>       ## running or not, start it again.
>>>       $0 stop
>>>       $0 start
>>>       ;;
>>> esac
>>>
>>> then you maybe need
>>>
>>> useradd red5
>>>
>>> and use like
>>>
>>> service red5 start
>>> service red5 stop
>>> service red5 restart
>>>
>>>
>>>
>>>
>>> _______________
>>> Sincerely
>>> Cristian Rusu
>>> ==============
>>> www.crilance.com
>>> Web Development & Electronic Publishing
>>> Chat  crirus74  Crirus  crirus at hotmail.com
>>> Contact Me
>>>
>>>
>>>
>>> On Fri, Oct 30, 2009 at 11:07, Jeremy Morton <admin at game-point.net>
>>> wrote:
>>>
>>> On Fri, 30 Oct 2009 09:36:56 +0100, Debian User <testpresta at laposte.net>
>>> wrote:
>>>
>>> Hello
>>>>
>>>> I have install red5 by compiling source from svn.
>>>>
>>>> I have juste a red5.sh start script.
>>>>
>>>> When i want to stop red5, i am killing red5 process.
>>>>
>>>> Is there an official start/stop script for this red5 distribution ?
>>>>
>>>
>>>
>>> I put up a guide about how to make such a script for RedHat-based OSes on
>>> Red5Wiki, here:
>>>
>>> http://red5wiki.com/wiki/Installing_and_running_Red5
>>>
>>> Anyone writing similar guides for other OSes would be greatly
>>> appreciated!
>>> :-)
>>>
>>> Best regards,
>>> Jeremy Morton (Jez)
>>>
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> http://gregoire.org/
>>> http://code.google.com/p/red5/
>>> http://code.google.com/p/blue5/
>>>
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>
>>  ------------------------------
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>  ------------------------------
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20091030/c80baa9b/attachment-0001.html>


More information about the Red5 mailing list