在我的守护进程停止之前,我需要调用另一个程序。
我的第一次尝试是使用ExecStopPre类似于ExecStartPre但根据https://bugs.freedesktop.org/show_bug.cgi?id=73177这不受支持,我应该使用“多个 ExecStop”。
有人有这方面的例子吗?我应该如何杀死守护进程ExecStop?
小智 11
您将多行与 ExecStop (来自 node.js 服务):例如
[Service]
ExecStartPre=/usr/local/bin/npm run build
ExecStartPre=-/bin/rm local.sock
ExecStart=/usr/local/bin/npm --parseable start
ExecStop=/usr/local/bin/npm --parseable stop
ExecStop=-/bin/rm local.sock
RestartSec=300
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nodejs
User=nobody
Group=nobody
Environment=NODE_ENV=dev
Environment=PORT=3000
WorkingDirectory=/var/www/nodejs/quaff
UMask=007
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10235 次 |
| 最近记录: |