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

#!/bin/bash
#chkconfig:345 61 61 //此行的345參數(shù)表示,在哪些運(yùn)行級別啟動,啟動序號(S61);關(guān)閉序號(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