如何在Ubuntu 14.04上添加Red5后台启动?
我按照这里的说明通过tarball手动安装red5
,因为apt-get不适用于Ubuntu 14.04: Ubuntu Trusty red5-server安装无法启动
即使手动安装依赖项,服务器也总是会失败。 red5服务器现在可以工作,但终端必须打开并挂在那里。 我需要一个启动脚本来在后台运行该过程。 这里的对话: http : //chat.stackexchange.com/rooms/29197/discussion-between-umi-and-pl-rock
我跟着,但它不能正常工作。 结果是:
在init.d/red5
我有两行 – start on filesystem
& exec /bin/bash /usr/share/red5.sh
。
update rc.d red5 defaults
返回:
missing LSB information
sudo service red5 stop
返回:
stop: Unknown instance
sudo service red5 start
返回:
red5 stop/waiting
抱歉,我在聊天中写错了语法。
第一种方法:
在/etc/init.d
下创建任何文件
sudo nano /etc/init.d/red5
添加行
#!/bin/sh cd /full-path/red5-server-1.0.6-RELEASE/ && ./red5.sh &
保存此文件并退出然后使其可执行
sudo chmod ugo+x /etc/init.d/red5
然后运行命令
sudo update-rc.d red5 defaults
你的问题解决了。 你可以开始使用它
sudo service red5 start
第二种方法:
你可以使用/etc/rc.local
。
/etc/rc.local
是您可以自定义自己的守护程序以在后台运行的地方。 守护进程是运行您希望系统在后台运行的任何脚本的工作。 这是系统在向您发布系统之前选择启动守护程序的地方。
用命令打开它
sudo nano /etc/rc.local
在exit 0
之前添加bellow命令
cd /full_path/red5-server-1.0.6-RELEASE/ && ./red5.sh &
你可以测试它是否正常工作
sh /etc/rc.local
下次启动系统或重新启动时,red5服务器将在后台运行。 它会工作。
第三种方法:
在/etc/init
下创建任何.conf
文件
sudo nano /etc/init/red5.conf
添加波纹管线
start on runlevel [2345] stop on runlevel [016] exec /full-path/red5-server-1.0.6-RELEASE/red5.sh
现在你启动服务器
sudo service red5 start
如果你想创建更好的新贵,那么请阅读Upstart Intro,Cookbook和Best Practices