Linux 的服務多以 daemon 形式運行,常見分為 standalone 與 super daemon 兩類。standalone 服務可獨立啟動,例如 httpd、vsftpd;super daemon 則由 xinetd 統一管理,等待請求時才啟動對應服務。
啟動腳本多在 /etc/init.d,服務設定常在 /etc 或 /etc/sysconfig,xinetd 設定在 /etc/xinetd.conf 與 /etc/xinetd.d,PID 則多放在 /var/run。
/etc/init.d/syslog start service httpd restart chkconfig --list httpd chkconfig --level 345 httpd on
若使用 xinetd,可編輯 /etc/xinetd.d 下的設定,將 disable 改為 no,再重新啟動 xinetd。
netstat -tulp netstat -lnp
這兩個指令可協助確認目前有哪些服務正在監聽。