【linux】CentOS7的系统服务(systemctl)

七八个星天IP属地: 北京
字数 148阅读 679
通过systemctl命令执行对系统服务的操作

systemctl [OPTIONS...] COMMAND [NAME...]
例如启动网络服务
systemctl start NetworkManager
CentOS7有两个网络服务,其中network是为了兼容之前的版本,可以关掉network,只启动NetworkManager

systemctl stop network
systemctl restart NetworkManager
设置服务的开机自启动

设置自启动

systemctl enable NetworkManager

取消自启动

systemctl disable NetworkManager

查看服务的自启动情况,enable/disable/static,static依赖于其他服务的服务,本身不考虑是否自启动

systemctl list-unit-files
[root@linux ~]# systemctl list-unit-files
UNIT FILE                                     STATE   
proc-sys-fs-binfmt_misc.automount             static  
dev-hugepages.mount                           static  
dev-mqueue.mount                              static  
proc-fs-nfsd.mount                            static  
proc-sys-fs-binfmt_misc.mount                 static  
run-vmblock\x2dfuse.mount                     disabled
sys-fs-fuse-connections.mount                 static  
sys-kernel-config.mount                       static  
sys-kernel-debug.mount                        static  
tmp.mount                                     disabled
var-lib-nfs-rpc_pipefs.mount                  static  
brandbot.path                                 disabled
cups.path                                     enabled 
systemd-ask-password-console.path             static  

防火墙服务是firewalld,可用上面的命令进行停止/启动/重启/设置自启动/取消自启动

`

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
0人点赞
更多精彩内容,就在简书APP
"小礼物走一走,来简书关注我"
还没有人赞赏,支持一下
总资产1共写了7768字获得7个赞共2个粉丝

推荐阅读更多精彩内容