QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1167|回复: 3

如何做到开机自动运行一个命令?

[复制链接]
发表于 2005-3-12 10:33:17 | 显示全部楼层 |阅读模式
如题!


谢谢!
发表于 2005-3-12 10:50:39 | 显示全部楼层
/etc/rc.d/rc.local文件里
回复

使用道具 举报

 楼主| 发表于 2005-3-12 11:22:22 | 显示全部楼层
谢谢刀客!


我的这个文件是这样的:
----------------------------------------
#!/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
iptables-restore < /etc/sysconfig/iptables
-----------------------------------------
请问是不是这样touch /var/lock/subsys/local
iptables-restore < /etc/sysconfig/iptables
把新的依此添加就可以了呢?


请问touch /var/lock/subsys/local
这句是什么意思?


谢谢!
回复

使用道具 举报

发表于 2005-3-13 06:48:32 | 显示全部楼层
touch 是更新文件的time stamp.
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-10-3 08:24 , Processed in 0.040860 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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