11 12
发新话题
打印

你知道吗???

在一台装有linux的机器中,我想使它一开机即执行我编的程序,不必输入登入用户。      

TOP

把调用你程序的脚本放到/etc/rc.d/rc.sysinit文件里,即可。      
this message will self-destruct in 5 seconds......
我们的目标--------消灭蛀.....................零回复

TOP

你能告诉我具体过程吗!!谢谢11!!!!!      

TOP

你的可执行文件为/PATH/TO/DIR/ABC. P; H! J2 t" K1 M( }/ W
在rc.sysinit最后一行加入
- L) k( m* S1 n: `; @5 |7 S3 u8 P/PATH/TO/DIR/ABC
- c1 T; r5 o1 x; I! W' ~即可      
this message will self-destruct in 5 seconds......
我们的目标--------消灭蛀.....................零回复

TOP

谢谢你的帮助!!!以后请多多关照!!      

TOP

运行是成功了??但是,有个问题!!该程序是在检查eth0、eth1、lo之前执行的,我需要网络通讯,这样我不能进行网络通讯。有没有办法能解决这个问题啊!!      

TOP

可在/etc/inittab文件中加入一条语句即可。他的运行在eth0.lo之后。      

TOP

具体怎样做啊!!      

TOP

如果你的程序是/home/user1/run
  @0 [7 X4 E  T; D1 ^/ d& `, M在/ect/inittab中加入' n+ t7 F2 r5 J) a' J+ x6 x
#added by user1
# z3 b% M! k1 j3 t- |/ ~/ lt1:1235nce:/home/user1/run4 I& x0 \* z1 K+ |6 V
即可。
3 w0 Y3 o, s1 J* aonce means run one time,you can use respawn replace it if you want run your program again when your program died.
* b$ u7 @) {* Y# C0 u# Y4 p- y0 P7 d& B
      

TOP

个人认为放在/etc/rc.d/rc.local中更好      

TOP

 11 12
发新话题