精華區beta FreeBSD 關於我們 聯絡資訊
[email protected] (尋找我的最愛) writes: > FreeBSD 4.5R把 rc.local拿掉了... > 想請問一下要怎麼設定他自動啟動呢??...thx... 寫個 script 放到 /usr/local/etc/rc.d/ 底下去 這個 script 要能夠接受起碼兩個命令列參數 start , 假設是 maplebbs.sh 好了, FreeBSD 在 start-up 時 rc system 會一一呼叫 /usr/local/etc/rc.d/*.sh , 並且以 start 作為命令 列參數。如果那下面有 apache.sh , perforce.sh , maplebbs.sh 那做用就等於是這樣子去手動執行: /usr/local/etc/rc.d/apache.sh start /usr/local/etc/rc.d/perforce start /usr/local/etc/rc.d/maplebbs.sh start 在關機時則會以 stop 當作命令列參數去跑那些 script。 請注意副檔名一定要 .sh 而且要 chmod +x 至於 script 內部細節就是自己撰寫, 判斷命令列參數 start 時把 maple bbs 跑起來, stop 時則砍掉 bbs process 之類的。寫法可以 參考 apache.sh 等, 如果有裝 apache.sh 的話可以直接抄來小改一 下就 ok -- * Kang-min Liu <gugod at gugod dot org>