簡體   English   中英

重新啟動 Web 服務器(puma)后運行 sh 腳本

[英]Run sh script after restart web server (puma)

啟動(重新啟動)Puma Web 服務器后如何運行 sh 腳本? (systemd systemctl)

config/puma.rb

on_worker_boot do
  # Your shell script here executed with %x or system()
end

在您的 systemd 單元文件中,您可以在啟動后將 ExecStartPost=指令用於附加命令。

由於systemd提供了此功能,因此不需要像 Puma 這樣的每個框架都復制它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM