是否有可能更改系统托pipe服务使用什么标记进行日志logging? 例如,我的自定义服务report-daemon.service定义为 # … [Service] ExecStart=/usr/bin/php # … # … 显示为php而不是report-daemon (它似乎从ExecStart推断标签) $ sudo journalctl –unit report-daemon # … May 30 16:26:11 delta php[994]: Found 0 new revisions for Ctytn4a6zjw May 30 16:26:12 delta php[994]: Found 0 new revisions for efE8xuvUjAo # … 手册页没有列出在单元文件中设置的任何选项。 是否有可能在某处更改标签?
这个问题涉及到: autossh可靠的systemd服务 我有一个使用type = simple的服务。 这里systemd文档: Type = simple(默认):systemd认为服务立即启动。 该过程不得分叉。 如果需要在此服务上订购其他服务,则不要使用此types,除非它是套接字激活的。 想象一下,服务处于无限循环或挂起状态。 systemd如何知道服务是否正常? 如果系统和服务之间的IPC可能会有某种types的IPC吗? 我想要的是:我想要systemctl status foo-service来告诉我服务是否正常。 这不同于“服务的linux进程仍然存在”。
运行systemctl restart …时调用的单元文件中是否存在ExecStop指令systemctl restart …或者仅在执行文字systemctl stop …时调用?
我们有一个中央日志服务器(syslog-ng),我想提供一个漂亮的Web界面来查看日志。 我所看到的大多数都是可怕的破碎,过时,或只是很难受。 我不是很在意分析,但这是一个奖金。 任何build议?
所以我试图设置一些应用程序的后台进程,以开始使用systemd启动。 它总是给我127退出代码,我不知道为什么。 我以为ExecStart命令正在执行一个错误的目录。 所以我添加了ExecStartPre来输出当前的目录,但是它也没有被执行。 这是我的服务文件: [Unit] Description=Background processes [Service] Type=simple User=epic Environment=RAILS_ENV=production WorkingDirectory=/home/epic/application ExecStartPre=/bin/pwd > /home/epic/test.sys ExecStart=/usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake jobs:work 消息日志显示,当我执行systemctl start epic.service : Apr 24 05:13:01 application systemd[1]: epic.service: main process exited, code=exited, status=127 Apr 24 05:13:01 application systemd[1]: Unit epic.service entered failed state. 我怎么知道哪里出了问题! 我试图在shell中执行该命令,它工作(如果它在正确的目录中)。 服务器在Fedora 15上运行。
我只是做了上面提到的升级,但它似乎像systemd不工作,因为它应该。 如果我运行像systemctl start apache2这样的命令,我会收到消息 无法连接到总线:没有这样的文件或目录 奇怪的service apache2 start仍在工作。 我不得不两次开始升级,因为第一次出错了,所以我认为这可能与此有关。 有没有办法手动从新贵切换到systemd同时保持所有的工作服务?
我正在使用systemd来pipe理Ubuntu 16上的程序。我似乎无法从程序中获取日志以输出到journalctl或/var/log/syslog 。 日志configuration是缺省configuration,至less应将所有日志消息<debug到syslog。 这里是杂志的conf: >> cat /etc/systemd/journald.conf # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # […]
我有传统上通过syslog-ng保存在/ var / log /pipe道中的日志。 日志可以达到每天的TB级大小。 为了使他们更易于pipe理。 我想通过服务器和应用程序群集将其分解出来。 这是做这件事的最好方法吗? 我该如何使用可pipe理的Syslog-ng来做到这一点?
只是澄清的事情 – 我正在一个systemd服务文件celerybeat.service应该照顾芹菜节拍。 我现在正在做的是调用一个脚本,该脚本读取/var/run/celery/celerybeat.pid ,用该PID杀死进程,然后再次启动Celery节拍进程。 有没有更好的方法来完成这个?
这是我的计时器: [Unit] Description=Do whatever [Timer] OnCalendar=daily UTC [Install] WantedBy=timers.target 它无法开始以下错误: Failed to start mytimer.timer: Unit mytimer.timer failed to load: Invalid argument. See system logs and 'systemctl status mytimer.timer' for details. 令人遗憾的是systemctl status并没有增加任何清晰的错误信息 但是,如果我删除UTC文字,它完美的作品: [Unit] Description=Do whatever [Timer] OnCalendar=daily [Install] WantedBy=timers.target 我究竟做错了什么? 本文档描述了OnCalendar接受的格式,并显示可以使用UTC。 是的,我尝试使用引号 – 没有帮助。 我也尝试使用规范化的forms – 同样的事情 版本: 操作系统:CentOS 7 内核:3.10.0-042stab113.21 systemd:systemd-219-19.el7_2.9.x86_64