惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
W
WeLiveSecurity
D
DataBreaches.Net
Attack and Defense Labs
Attack and Defense Labs
H
Heimdal Security Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
AI
AI
P
Proofpoint News Feed
PCI Perspectives
PCI Perspectives
Schneier on Security
Schneier on Security
T
Threatpost
GbyAI
GbyAI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
F
Full Disclosure
T
Threat Research - Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
M
MIT News - Artificial intelligence
L
Lohrmann on Cybersecurity
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
Y
Y Combinator Blog
腾讯CDC
The Hacker News
The Hacker News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园_首页
Simon Willison's Weblog
Simon Willison's Weblog
L
LINUX DO - 最新话题
Security Latest
Security Latest
Know Your Adversary
Know Your Adversary
Forbes - Security
Forbes - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
SegmentFault 最新的问题
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
LangChain Blog
Vercel News
Vercel News
Cisco Talos Blog
Cisco Talos Blog
量子位
P
Proofpoint News Feed
H
Hacker News: Front Page
Help Net Security
Help Net Security
L
LINUX DO - 热门话题
Project Zero
Project Zero
C
Cisco Blogs

on on CoreDNS: DNS and Service Discovery

暂无文章

on
2018-01-22 · via on on CoreDNS: DNS and Service Discovery

Description

on executes a command when a specified event is triggered. This can be useful for preparing to serve a site by running a script or starting a background process when the server starts, or for stopping it when the server exits.

Each command that is executed is blocking, unless you suffix the command with a space and &, which will cause the command to be run in the background. (Do not do this when the server is exiting, or the command may not finish before its parent process exits.) The output and error of the command go to standard output and standard error, respectively. There is no standard input.

A command will only be executed once for each time it appears in the Corefile. In other words, even if this directive is shared by more than one zone, a command will only execute once per appearance in the Corefile.

Note that commands scheduled for the shutdown event will not execute if CoreDNS is force-terminated, for example, by using a “Force Quit” feature provided by your operating system. However, a typical SIGINT (Ctrl+C) will allow the shutdown commands to execute.

Syntax

on EVENT COMMAND

EVENT is the name of the event on which to execute the COMMAND (see list below). COMMAND is the command to execute; it may be followed by arguments.

Events

Commands can execute on the following events:

  • startup - The server instance is starting or starting up
  • shutdown - The server instance is shutting down (not restarting)

Examples

Start php-fpm before the server starts listening:

on startup /etc/init.d/php-fpm start

Stop php-fpm when the server quits:

on shutdown /etc/init.d/php-fpm stop

On Windows, you might need to use quotes when the command path contains spaces:

on startup "\"C:\Program Files\PHP\v7.0\php-cgi.exe\" -b 127.0.0.1:9123" &