监督 syslog-ng 不在后台运行
下面是我的 syslog-ng 单元脚本。我可以看到没有监督 syslog-ng 运行的进程。每当 syslog-ng 失败时,我都必须手动重新启动。如果我们可以在 syslog-ng 失败/停止时自动运行脚本,谁能告诉我一下吗?
cat /usr/lib/systemd/system/syslog-ng.service
[Service]
Type=notify
Sockets=syslog.socket
ExecStart=/usr/sbin/syslog-ng -F -p /var/run/syslogd.pid --fd-limit=90000
ExecReload=/bin/kill -HUP $MAINPID
StandardOutput=null
Restart=on-failure
ps aux |grep syslog-ng
root 12548 110 1.1 8715368 6856976 ? xxx Mar21 2719:38 /usr/sbin/syslog-ng -F -p /var/run/syslogd.pid --fd-limit=90000
Below is my syslog-ng unit script. I could see there is no process with supervising syslog-ng running. Whenever syslog-ng is failed, I had to restart manually . Can anyone please let me now if we can automate script to run the syslog-ng if it is failing/stopped.
cat /usr/lib/systemd/system/syslog-ng.service
[Service]
Type=notify
Sockets=syslog.socket
ExecStart=/usr/sbin/syslog-ng -F -p /var/run/syslogd.pid --fd-limit=90000
ExecReload=/bin/kill -HUP $MAINPID
StandardOutput=null
Restart=on-failure
ps aux |grep syslog-ng
root 12548 110 1.1 8715368 6856976 ? xxx Mar21 2719:38 /usr/sbin/syslog-ng -F -p /var/run/syslogd.pid --fd-limit=90000
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
syslog-ng 的管理进程仅在 init.d 系统上使用。
使用systemd,可以通过配置服务的
重新启动
相关选项来实现相同的功能(sudo systemctl edit syslog-ng
):https://www.freedesktop.org/software/systemd/man/systemd.service.html#Restart=
The supervisor process of syslog-ng is used only on init.d systems.
With systemd, the same functionality can be achieved by configuring the
Restart
-related options of the service (sudo systemctl edit syslog-ng
):https://www.freedesktop.org/software/systemd/man/systemd.service.html#Restart=