监督 syslog-ng 不在后台运行

发布于 2025-01-16 05:04:36 字数 546 浏览 3 评论 0原文

下面是我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌路终见情 2025-01-23 05:04:36

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=

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文