首页 > 其他 > 详细

编写systemd下服务脚本

时间:2018-09-08 15:03:30      阅读:232      评论:0      收藏:0      [点我收藏+]

编写systemd下服务脚本

一、在/lib/systemd/system目录下建立服务脚本

sshd.service 必须以service结尾

二、填写内容

[Unit]

Description=SSH Key Generation

 

[Service]

Type=oneshot

RemainAfterExit=yes

 

ExecStart=/etc/init.d/sshd  start

 

[Install]

WantedBy=multi-user.target

 

三、根据脚本后面的WantedBy=multi-user.target

在对于路径建立链接

Cd   /etc/systemd/system/multi-user.target.wants

Ln -s  /etc/systemd/system/multi-user.target.wants/sshd.service   sshd.service

 

编写systemd下服务脚本

原文:https://www.cnblogs.com/liushuhe1990/p/9609019.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!