找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4749|回复: 13

高手近来帮帮忙

[复制链接]
发表于 2004-12-29 20:02:15 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
CL里面 怎么可以做到 用守护程序 启动软件?还有。 当在rc.local里面执行有循环的程序后  路由不能进入登陆界面。请问出现登陆界面后,那个文件可以放置这些带无限循环的程序?例如:防止IP冲突的程序一样。 那断每秒循环一次发送MAC的程序应该放哪里?
routeros
发表于 2004-12-29 20:19:28 | 显示全部楼层
QUOTE
每秒循环一次
太频繁了吧?你用cron就可以的。自启动直接写在 rc.local里面就是了
routeros
回复

使用道具 举报

 楼主| 发表于 2004-12-29 20:59:00 | 显示全部楼层
我知道自启动写入rc.local   我要的是 某些程序占用shell  不能继续运行。如果写入rc.local 那就不能进入登陆窗口。或者这样。  你把top写进rc.local  然后重起。 通过ssh控制。 你会发现,你不能重起。明白我的意思吗?  我想找到一个地方。开机自动启动。 但不影响整个系统继续执行
routeros
回复

使用道具 举报

发表于 2004-12-29 21:25:32 | 显示全部楼层
可以试试这个程序。我抽空帮大家编译一下。

QUOTE
Can I run CTorrent as a background process? 2004-02-01 07:39:16 Yes, the best way to do this is by using the GNU "screen" program. Screen is a program which creates a virtual shell which allows you to deattach from it and then at a later time return and resume it. The programs run inside this virtual shell will not stop or suspend itself even if you dettach. Most unix and linuxs systems have screen already, but if you don't, get it from http://www.gnu.org/software/screen/.We strongly recommend reading the manual for this program, but here is a quick reference for the impatient:  screen ctorrent myfile.torrentWill start a new screen session with ctorrent. Hit CTRL-A and then D to deattach from this session, it should get you back to your normal shell. To resume the screen again, type:  screen -xIf you have multiple screens running, you need to specify which screen session you want to resume. To list all, type  screen -listAnd to resume one of them, use the syntax:  screen -r pid.tty.hostpid.tty.host is printed for each screen session by "screen -list". There are LOTS of things you can do with screen, please refer to the manual for more details.
routeros
回复

使用道具 举报

发表于 2004-12-29 22:25:05 | 显示全部楼层
QUOTE (EMP @ Dec 29 2004, 08:59 PM)
我知道自启动写入rc.local   我要的是 某些程序占用shell  不能继续运行。如果写入rc.local 那就不能进入登陆窗口。或者这样。  你把top写进rc.local  然后重起。 通过ssh控制。 你会发现,你不能重起。明白我的意思吗?  我想找到一个地方。开机自动启动。 但不影响整个系统继续执行  
  CL 也同样有多个控制台的。此外,即使你不进入控制台系统一样可以运行的。
routeros
回复

使用道具 举报

 楼主| 发表于 2004-12-29 22:47:41 | 显示全部楼层
你还不明白呀。不是多少控制台的问题。。。如果rc.local加入top    top运行后 是不会释放控制权。 所以路由就不能运行到登陆界面。当你远程控制它的时候。 问题来了。   他还没释放控制权。你ssh可正常使用。运行指令。但是当你重新启动。 或者关机.. 你会发现。 不论你怎么发出reboot   他不不会管你。就是不重起。。。那么 如果我想起动时自动启动一些好像top这类不放控制权的软件。那就变成没办法了。还有。 防止ip冲突那个。。。  他不断循环。 如果写进rc.local 也是一样
routeros
回复

使用道具 举报

发表于 2004-12-29 22:53:45 | 显示全部楼层
是的,我注意到了,如果写到rc.local中,系统是无法启动ssh进程的。
routeros
回复

使用道具 举报

 楼主| 发表于 2004-12-29 23:54:03 | 显示全部楼层
ssh可以呀  我的ssh启动在rc.local前。。
routeros
回复

使用道具 举报

发表于 2004-12-30 01:13:51 | 显示全部楼层
明白了。不过你可以把程序放到后台执行啊,不必等到程序结束的。标准的 Shell 哦。。
routeros
回复

使用道具 举报

头像被屏蔽
发表于 2004-12-30 09:29:54 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
routeros
回复

使用道具 举报

 楼主| 发表于 2004-12-30 09:49:57 | 显示全部楼层
把程序放到后代?  就是用进程启动。linux使用 service 程序 start  但CL 没有service  请问怎么使用后台?请说明
routeros
回复

使用道具 举报

发表于 2004-12-30 10:05:30 | 显示全部楼层
就是在命令后面加个 & 符号。不过我没在rc.d里面做测试的。你做下看看。网络上好多shell的文章,关于后台执行的。
routeros
回复

使用道具 举报

发表于 2004-12-30 10:44:10 | 显示全部楼层
举个例子吧。比如 top。我想让它在后台执行,可以这样:

CODE
top &
但是仍然有输出,如果不想看到输出。(对这个命令没什么意义的)可以执行:

CODE
top 1>&-
上面这个是关闭标准输出。如果该命令会产生错误输出。需要同时关闭错误输出:

CODE
top 1>&- 2>&-
或者干脆这样:

CODE
command &/dev/null &
linux下的解决方法特别多,上面才是 几个而已。。。
routeros
回复

使用道具 举报

 楼主| 发表于 2004-12-30 14:54:46 | 显示全部楼层
噢。。。 对。。。。。哈哈  谢谢。。。。&&&&&&&&&&&&&&&&&
routeros
回复

使用道具 举报

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

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-9-20 00:08 , Processed in 0.060577 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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