1、編輯檔案 /etc/rc.local
vim /etc/rc.local
#!/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
#在檔案末尾加上你開機需要啟動的程式或執行的指令即可(執行的程式需要寫絕對路徑,添加到系統環境變量的除外),如
/usr/local/thttpd/sbin/thttpd -C /usr/local/thttpd/etc/thttpd.conf
2、自己寫一個shell腳本