#2
|
|||
|
|||
寫一小檔案,
#!/bin/sh ...............(指令) ...............(指令) ...............(指令) 存檔 filename 改權限 chmod 700 filename 執行 ./filename (enter) |
#4
|
|||
|
|||
加到 /etc/rc.local 檔案
/存放目錄/./filename |
#6
|
|||
|
|||
引用:
2. 修改檔案內容 => vi /所在目錄/StartMe 3. 給予執行(x)的屬性 => chmod 700 StartMe 4. 修改 /etc/rc.d/rc.local => vi /etc/rc.d/rc.local 5. 加入StartMe檔案位置 => /所在目錄/StartMe |
#7
|
||||
|
||||
引用:
如果是按我既有的/etc/rc.local,我都如此做了,還是無效? 該要執行的檔案本身好像也是一個這種檔案,附檔名是.SH,只因它本身也是在/home/xxx/xxx/xxxx.sh之下,每次開機後還要經過一層層目錄才能下達./xxxx.sh的指令讓它動作。目前已照ismile所說自己另設一個123檔,一進到root目錄下就只要打./123就可執行,這一點已經成功了。 就是想再懶一點讓它一開機就自動執行...... ? |
#8
|
|||
|
|||
試試 /路徑/blah/blah/./檔名
像 /root/./xxxx.sh |
#9
|
|||
|
|||
引用:
引用:
#!/bin/sh /var/bin/apachectl start <==(這行是假設) /home/xxx/xxx/program <==(這行是假設) /home/xxx/xxx/xxxx.sh <==加入這一行,您說的那一個檔案位置 /root/123 <==或是加入這一行,您設定的123檔案 這樣不能自動啟動嗎? |
#10
|
||||
|
||||
代碼:
#!/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 /home/123flashchat/server/./fcserver.sh 引用:
但為何前面那行不行?我懷疑路徑有問題?這個home到底在哪個主目錄之下啊? |