IT 紀錄網站

Don't stop running forward!


  • 首頁

  • archive

  • 關於我

  • Search

linux centos systemd create service

Published at: 2022/02/21   |   Categories: linux   centos   rocky linux   systemd   | Words: 72 words | Reading: 1 minutes | Visited:

有些程式沒有包裝成 service 執行以此篇為記錄

先寫一個腳本或是程式 該腳本能正常執行並不停止

建立 service file /etc/systemd/system/coredns.service

[Unit]
Description=coredns

[Service]
Type=simple
ExecStart=/root/coredns/coredns -conf corefile
Restart=always

[Install]
WantedBy=multi-user.target

設定權限、reload server

chmod 644 /etc/systemd/system/coredns.service
systemctl daemon-reload
#linux# #centos# #rocky linux# #systemd#
comments powered by Disqus >
  • Table of Content
  • Site Information
Elkan.Li

Elkan.Li

Never forget your dreams!

0 Blogs
18 Categories
26 Tags
GitHub ZhiHu
Links
  • Nutz
  • JFinal
  • Wendal
  • LiaoXueFeng
TagCloud
  • Windows
  • Centos
  • Centos 7
  • Linux
  • Markdown
  • Rocky linux
  • Anti virus
  • Bareos
  • Chrony
  • Css
© 2010 - 2022 IT 紀錄網站
Powered by - Hugo v0.92.2 / Theme by - NexT
/
0%