0

I followed the instructions in here to install red5 manually through tarball because the apt-get does not work for Ubuntu 14.04: Ubuntu Trusty red5-server installation fails to start

Even with installing the dependencies manually the server will always fail. The red5 server now works but the terminal must be open and just hang there. I need a startup script to run the process in the background. The conversation here: http://chat.stackexchange.com/rooms/29197/discussion-between-umi-and-pl-rock

I followed but it doesn't work properly. Now the result is:

In init.d/red5 I have two lines - start on filesystem & exec /bin/bash /usr/share/red5.sh.

update rc.d red5 defaults returns:

missing LSB information

sudo service red5 stop returns:

stop: Unknown instance

sudo service red5 start returns:

red5 stop/waiting
Joe W
  • 3

1 Answers1

2

sorry by mistake i wrote there wrong syntax in chat .

First method :

create any file under /etc/init.d

sudo nano /etc/init.d/red5

add lines

 #!/bin/sh
cd /full-path/red5-server-1.0.6-RELEASE/ && ./red5.sh &

save this file and exit then make it executable

sudo chmod ugo+x /etc/init.d/red5

then run command

sudo update-rc.d red5 defaults

your problem is solved. you can start it using

sudo service red5 start

Second method :

you can use /etc/rc.local.
/etc/rc.local is where you can customize your own daemon to run in the background. Daemon is what does the job in running whichever scripts you want system to run in the background. This is where the system picks up to start daemons before releasing the system to you for your use.

open it using command

sudo nano /etc/rc.local

add bellow command before exit 0

cd /full_path/red5-server-1.0.6-RELEASE/ && ./red5.sh &

and you can test if this is working correctly or not

sh /etc/rc.local

next time you start your system or reboot your red5 server will run in background. it will work.

Third method :

create any .conf file under /etc/init

sudo nano /etc/init/red5.conf

add bellow lines

start on runlevel [2345]
stop on runlevel [016]
exec /full-path/red5-server-1.0.6-RELEASE/red5.sh

now you start server

sudo service red5 start

if you want to create better upstart then read Upstart Intro, Cookbook and Best Practises

pl_rock
  • 11,715