栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Linux下服务的创建以及开机启动

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Linux下服务的创建以及开机启动

Linux下服务的创建以及开机启动
    • linux下服务的定义在 /lib/systemd/system 中,我们只需要编写符合标准规范的service脚本文件,放在这个文件夹下面即可。
    • 服务启动相关
      • 编写服务设置启动
      • rc.local中设置开机启动
    • 参考

linux下服务的定义在 /lib/systemd/system 中,我们只需要编写符合标准规范的service脚本文件,放在这个文件夹下面即可。 服务启动相关 编写服务设置启动
systemctl list-unit-files
enabled:开机启动
disabled:开机不启动

[ sysadmin:~ ]# 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-vmblockx2dfuse.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  
systemd-ask-password-plymouth.path                                            static  
systemd-ask-password-wall.path                                                static  
docker-1558df48f7364a8b70979495e804e434834f7624253ca6651eabb9d0af30b221.scope static  
设置docker服务开机启动
systemctl enable docker
开机不启动
systemctl disable docker
rc.local中设置开机启动

参考

Linux下服务的创建

linux 7服务取消开机自启,centos7中设置服务开机自启的两种方法,欢迎补充

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/693474.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号