如何給網(wǎng)站添加搜索關(guān)鍵字網(wǎng)絡(luò)營銷有哪些方式
引言
systemctl 是 Linux 系統(tǒng)中用于管理 systemd 服務(wù)的命令行工具。它可以用來啟動、停止、重啟服務(wù),管理服務(wù)的開機(jī)自啟動,以及查看服務(wù)的狀態(tài)等。
什么是 systemd?
systemd 是現(xiàn)代 Linux 發(fā)行版中默認(rèn)的 初始化系統(tǒng)(init system),負(fù)責(zé)在系統(tǒng)啟動時加載和管理服務(wù)與進(jìn)程。
適用范圍
systemctl 可用于大多數(shù)基于 systemd 的 Linux 發(fā)行版,如 Debian、Ubuntu、CentOS、Fedora 等。
(比如Gentoo默認(rèn)使用的是OpenRC)
解決方法
這邊以mysql服務(wù)為例
禁用開機(jī)自啟
sudo systemctl disable mysql
ying@192:~$ systemctl disable mysql.service
Removed "/etc/systemd/system/multi-user.target.wants/mysql.service".
查看是否禁用成功(如果為disable則以禁用開機(jī)自啟動)
systemctl is-enabled mysql
ying@192:~$ systemctl is-enabled mysql
disabled
擴(kuò)展
如果只是暫時需要關(guān)閉服務(wù),那么使用stop
sudo systemctl stop mysql
如果需要開啟,那么使用start
sudo systemctl start mysql
查詢服務(wù)的運(yùn)行狀態(tài),使用status
sudo systemctl status mysql