国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

centos7系統(tǒng)服務(wù)管理命令systemctl

2017-03-15 20:19:59 8525

systemctl命令是系統(tǒng)服務(wù)管理器指令,它實(shí)際上將servicechkconfig這兩個(gè)命令組合到一起。

任務(wù)

舊指令

新指令

使某服務(wù)自動(dòng)啟動(dòng)

chkconfig --level 3 httpd on

systemctl enable   httpd.service

使某服務(wù)不自動(dòng)啟動(dòng)

chkconfig --level 3 httpd off

systemctl disable httpd.service

檢查服務(wù)狀態(tài)

service httpd status

systemctl status httpd.service (服務(wù)詳細(xì)信息) systemctl is-active   httpd.service (僅顯示是否   Active)

顯示所有已啟動(dòng)的服務(wù)

chkconfig --list

systemctl list-units --type=service  

啟動(dòng)某服務(wù)

service httpd start

systemctl start httpd.service

停止某服務(wù)

service httpd stop

systemctl stop httpd.service

重啟某服務(wù)

service httpd restart

systemctl restart httpd.service

實(shí)例:

 

1.啟動(dòng)nfs服務(wù)

systemctl start nfs-server.service

 

2.設(shè)置開(kāi)機(jī)自啟動(dòng)

systemctl enable nfs-server.service

 

3.停止開(kāi)機(jī)自啟動(dòng)

systemctl disable nfs-server.service

 

4.查看服務(wù)當(dāng)前狀態(tài)

systemctl status nfs-server.service

 

5.重新啟動(dòng)某服務(wù)

systemctl restart nfs-server.service

 

6.查看所有已啟動(dòng)的服務(wù)

systemctl list -units --type=service

 

開(kāi)啟防火墻22端口

iptables -I INPUT -p tcp --dport 22 -j accept

 

如果仍然有問(wèn)題,就可能是SELinux導(dǎo)致的

關(guān)閉SElinux

修改/etc/selinux/config文件中的SELINUX=””為disabled,然后重啟。

 

 

徹底關(guān)閉防火墻:

sudo systemctl status firewalld.service

sudo systemctl stop firewalld.service

sudo systemctl disable firewalld.service


提交成功!非常感謝您的反饋,我們會(huì)繼續(xù)努力做到更好!

這條文檔是否有幫助解決問(wèn)題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問(wèn)題: