寫了腳本,想用命令chkconfig加載自啟動(dòng).提示"**服務(wù)不支持chkconfig",原來(lái)是自己寫的腳本時(shí),忘記寫兩行了.開頭一般要這樣寫

#!/bin/bash
#chkconfig:345 61 61 //此行的345參數(shù)表示,在哪些運(yùn)行級(jí)別啟動(dòng),啟動(dòng)序號(hào)(S61);關(guān)閉序號(hào)(K61)
#description:Apache //此行必寫,描述服務(wù).

把腳本拷貝至/etc/init.d/目錄下,執(zhí)行命令:
#ln -s /etc/init.d/httpd /etc/rc.d/rc3.d/S61httpd
#ln -s /etc/init.d/httpd /etc/rc.d/rc4.d/S61httpd
#ln -s /etc/init.d/httpd /etc/rc.d/rc5.d/S61httpd

再執(zhí)行
#chkconfig --levels httpd 345 on