通常在接受新主機時可以利用 service –status-all 指令來查詢目前主機上正在跑那些服務,有時某些功能只是服務未啟動,簡單的重啟就可以解決問題,千萬不要直接去看程式除錯,因為通常原本正常在跑的程式不會突然壞掉。
service –status-all
[ + ] acpid
[ + ] apache-htcacheclean
[ + ] apache2
[ + ] apparmor
[ + ] apport
[ + ] atd
[ – ] console-setup.sh
[ + ] cron
[ – ] cryptdisks
[ – ] cryptdisks-early
[ + ] dbus
[ + ] ebtables
[ + ] fail2ban
[ + ] grub-common
[ – ] hibagent
[ – ] hwclock.sh
[ + ] irqbalance
[ + ] iscsid
[ – ] keyboard-setup.sh
[ + ] kmod
[ – ] lvm2
[ + ] lvm2-lvmetad
[ + ] lvm2-lvmpolld
[ + ] lxcfs
[ – ] lxd
[ – ] mdadm
[ – ] mdadm-waitidle
[ + ] mysql
[ + ] network-manager
[ – ] nfs-common
[ – ] nfs-kernel-server
[ – ] open-iscsi
[ – ] open-vm-tools
[ – ] plymouth
[ – ] plymouth-log
[ – ] pppd-dns
[ + ] procps
[ + ] redis-server
[ + ] rpcbind
[ – ] rsync
[ + ] rsyslog
[ – ] screen-cleanup
[ + ] sendmail
[ + ] ssh
[ + ] udev
[ + ] ufw
[ + ] unattended-upgrades
[ – ] uuidd
[ + ] vsftpd
狀態說明 :
- [ + ] 正在執行
- [ – ] 停用中
- [ ? ] 該服務無狀態
看單一服務的狀態
service apache2 status
重啟服務
service apache2 restart