Linux 7開機自啟項查看並設置


  在Linux6中查看及設置開機自啟信息是使用chkconfig命令,Linux7中此命令已經被替代,接下來我們就來研究下Linux7中的區別所在。

chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

netconsole     	0:off	1:off	2:off	3:off	4:off	5:off	6:off
network        	0:off	1:off	2:on	3:on	4:on	5:on	6:off
vmware-tools   	0:off	1:off	2:on	3:on	4:on	5:on	6:off

  首先我們可以發現,雖然Linux7中已經不再使用chkconfig命令來管理服務是否開機自啟,但是此命令仍舊可用,但是輸出信息提示我們使用chkconfig命令的輸出只是唄SysV所管理的服務,不包括systemd管理的服務,如果想在CentOS7中查看systemd管理的服務需要使用以下命令:

systemctl list-unit-files

  • 查看systemd開機自啟服務
    systemctl list-unit-files |grep enabled
  • 設置某服務開機自啟
    systemctl enable smb nmb
  • 關閉某服務開機自啟
    systemctl disable smb nmb


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM