LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1980|回复: 18

开机如何让服务器自动运行?

[复制链接]
发表于 2005-2-28 20:25:07 | 显示全部楼层 |阅读模式
作了一个CS1.5的服务器,

系统是RedHat9.0
游戏的安装目录/root/cs15/

服务器启动文件cs.sh   启动文件目录/root/cs15/root/root/cs/hlds_l


想在开机运行服务器,请问改那个文件?
加什么命令?
感谢!
发表于 2005-2-28 20:33:44 | 显示全部楼层

将cs.h文件放到/etc/rc.d/rc.local 文件里.系统在启动的时候会自动运行的

uqf
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-28 20:39:20 | 显示全部楼层
这样子行不行?

#!/bin/sh  
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
cd /root/cs15/root/root/cs/hlds_l &
./cs.sh &


注:粗体是我加进去的内容!


我已经用上面的这个了,不行,错在什么地方!!如何改?
回复 支持 反对

使用道具 举报

发表于 2005-2-28 20:39:57 | 显示全部楼层
Post by yibaidu
作了一个CS1.5的服务器,

系统是RedHat9.0
游戏的安装目录/root/cs15/

服务器启动文件cs.sh   启动文件目录/root/cs15/root/root/cs/hlds_l


想在开机运行服务器,请问改那个文件?
加什么命令?
感谢!


echo "sh /PWD/cs.sh" >> /etc/rc.d/rc.local
"WD"为你个CS.SH的文件位置~
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-28 20:41:57 | 显示全部楼层
请看三楼,对不对,错在什么地方?
回复 支持 反对

使用道具 举报

发表于 2005-2-28 20:49:30 | 显示全部楼层
有报错吗?把报信息贴出来
回复 支持 反对

使用道具 举报

发表于 2005-2-28 21:04:49 | 显示全部楼层
Post by yibaidu
这样子行不行?

#!/bin/sh  
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
cd /root/cs15/root/root/cs/hlds_l &
./cs.sh &


注:粗体是我加进去的内容!


我已经用上面的这个了,不行,错在什么地方!!如何改?





把错误提示也发现来看看.
回复 支持 反对

使用道具 举报

发表于 2005-2-28 21:05:31 | 显示全部楼层

把错误提示也发出来看看

Post by yibaidu
这样子行不行?

#!/bin/sh  
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
cd /root/cs15/root/root/cs/hlds_l &
./cs.sh &


注:粗体是我加进去的内容!


我已经用上面的这个了,不行,错在什么地方!!如何改?





把错误提示也发现来看看.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-28 21:11:46 | 显示全部楼层
机子启动后,还是无法启动服务器,
没有任何报错信息。
回复 支持 反对

使用道具 举报

发表于 2005-2-28 21:21:02 | 显示全部楼层

  1. echo "sh /PWD/cs.sh" >> /etc/rc.d/rc.local
  2. "PWD"为你个CS.SH的文件位置~
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表