linux 编写服务启动单元

服务配置文件 /usr/lib/systemd/system/nacos-server.service

[Unit]
Description=Nacos Config Server
After=mysql.service

[Service]
Type=forking
ExecStart=/opt/nacos/bin/startup.sh -m standalone
ExecReload=/opt/nacos/bin/shutdown.sh
ExecStop=/opt/nacos/bin/shutdown.sh

[Install]
WantedBy=multi-user.target

 

启动

systemctl start nacos-server

 

服务是在后台启动,所以 Service Type 使用的是 forking

 

233


 https://wiki.archlinux.org/index.php/systemd

posted on 2020-09-14 11:02  Lemo_wd  阅读(288)  评论(0)    收藏  举报

导航