[已解决][问题]arp -f这个命令如何实现开机自启动?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
fanglei03
帖子: 135
注册时间: 2008-02-23 21:52

[已解决][问题]arp -f这个命令如何实现开机自启动?

#1

帖子 fanglei03 » 2008-03-02 13:31

我在/etc/ethers中添加了ip mac,arp -f也成功绑定了,问题是每次开机都要手工绑一次,
我想让Ubuntu 实现开机自动绑定,不知道该怎么弄。。。
上网查了一下,说是在/etc/rc.d/rc.local下添加,但是我的系统中根本没有这个文件
上次由 fanglei03 在 2008-03-02 15:15,总共编辑 1 次。
头像
yaoms
帖子: 4952
注册时间: 2007-10-19 14:51
来自: 深圳

#2

帖子 yaoms » 2008-03-02 13:33

ubuntu中这个文件位于 /etc/rc.local 而不是 /etc/rc.d/rc.local

在里面添加你要执行的命令就行了
Nothing 有事请发邮件到 yms541 AT gmail.com
alias 爱慕颇雷尔='mplayer'
头像
fanglei03
帖子: 135
注册时间: 2008-02-23 21:52

#3

帖子 fanglei03 » 2008-03-02 13:42

yaoms 写了:ubuntu中这个文件位于 /etc/rc.local 而不是 /etc/rc.d/rc.local

在里面添加你要执行的命令就行了
但是我看了这个文件里的注释

代码: 全选

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
好像说的不是开机,是关机么
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#4

帖子 BigSnake.NET » 2008-03-02 13:49

代码: 全选

# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error. 
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
头像
fanglei03
帖子: 135
注册时间: 2008-02-23 21:52

#5

帖子 fanglei03 » 2008-03-02 14:09

大蛇引用那么一段想说明什么?
头像
fanglei03
帖子: 135
注册时间: 2008-02-23 21:52

#6

帖子 fanglei03 » 2008-03-02 14:10

对了,大蛇,我给你发邮件了,不知道你收到没有
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#7

帖子 BigSnake.NET » 2008-03-02 14:14

BigSnake.NET 写了:

代码: 全选

# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error. 
这个脚本将会在每个多用户运行级的最后执行
请确保脚本在成功时返回0, 在错误时返回非0
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
头像
yaoms
帖子: 4952
注册时间: 2007-10-19 14:51
来自: 深圳

#8

帖子 yaoms » 2008-03-02 14:15

# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.

此脚本在每个多用户运行级别(启动脚本)的最后步骤执行。
Nothing 有事请发邮件到 yms541 AT gmail.com
alias 爱慕颇雷尔='mplayer'
头像
fanglei03
帖子: 135
注册时间: 2008-02-23 21:52

#9

帖子 fanglei03 » 2008-03-02 14:19

想用好linux,不学好英语是不行了
可怜我的英语水平啊, :em19 :em19
头像
fanglei03
帖子: 135
注册时间: 2008-02-23 21:52

#10

帖子 fanglei03 » 2008-03-02 14:25

试过了,不行,我是直接在
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0

后面加了一行:arp -f
.... :em25
头像
yaoms
帖子: 4952
注册时间: 2007-10-19 14:51
来自: 深圳

#11

帖子 yaoms » 2008-03-02 14:30

加在 exit 0 这一行的前面 ,不然还没有执行就已经退出了
Nothing 有事请发邮件到 yms541 AT gmail.com
alias 爱慕颇雷尔='mplayer'
头像
fanglei03
帖子: 135
注册时间: 2008-02-23 21:52

#12

帖子 fanglei03 » 2008-03-02 15:15

OK,已经可以了,谢谢两位~~~ :em52 :em51
回复