Collectd.serviceを起動するときに「アクティブ:有効(自動再起動)」の問題を解決するには?

Collectd.serviceを起動するときに「アクティブ:有効(自動再起動)」の問題を解決するには?

実行に問題があります。収集サービスコマンドでインストールしたFedora 31 64ビットオペレーティングシステムsudo dnf install collectd。これを入力すると、sudo systemctl status collectd.service次のような結果が表示されます。

    ● collectd.service - statistics collection daemon
       Loaded: loaded (/etc/systemd/system/collectd.service; enabled; vendor preset: disabled)
       Active: activating (auto-restart) since Sat 2020-09-19 18:18:47 CEST; 3s ago
         Docs: man:collectd(1)
      Process: 3796 ExecStart=/usr/sbin/collectd (code=exited, status=0/SUCCESS)
     Main PID: 3796 (code=exited, status=0/SUCCESS)
          CPU: 7ms

collectd.serviceところで、次の場所にあるファイルを手動で作成する必要がありました。/etc/systemd/system/目次。本当に奇妙なことは続けて有効(自動再起動) 状態=0/成功上記の出力から。また、次のコマンドをそれぞれの順序で実行しました。

  1. sudo systemctl daemon-reload
  2. sudo systemctl stop collectd.service
  3. sudo systemctl start collectd.service

...しかし何も変わりませんでした。これらすべてを実行した後、コンピュータを再起動し、上記の1)-3)の手順をすべて実行しましたが、何も助けませんでした。ところで、これは私のものですcollectd.service

[Unit]
Description=statistics collection daemon
Documentation=man:collectd(1)
After=local-fs.target network.target
Requires=local-fs.target network.target

[Service]
ExecStart=/usr/sbin/collectd
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog

[Install]
WantedBy=multi-user.target

私の/etc/collectd.confファイルは次のとおりです。

#
# Config file for collectd(1).
# Please read collectd.conf(5) for a list of options.
# http://collectd.org/
#

##############################################################################
# Global                                                                     #
#----------------------------------------------------------------------------#
# Global settings for the daemon.                                            #
##############################################################################

#Hostname    "localhost"
FQDNLookup   true
#BaseDir     "/var/lib/collectd"
#PIDFile     "/var/run/collectd.pid"
PluginDir   "/usr/lib64/collectd"
TypesDB     "/usr/share/collectd/types.db"

LoadPlugin cpu

<Plugin cpu>
  ReportByCpu false
  ReportByState false
#  Interval 1
  ValuesPercentage true
#  ReportNumCpu false
#  ReportGuestState false
#  SubtractGuestState true
</Plugin>

<Plugin memory>
        ValuesAbsolute false
        ValuesPercentage true
</Plugin>

Include "/etc/collectd.d"
LoadPlugin syslog
LoadPlugin logfile
#LoadPlugin log_logstash

<Plugin logfile>
        LogLevel info
        File "/var/log/error_syslog"
        Timestamp true
#       PrintSeverity false
</Plugin>

#<Plugin log_logstash>
#       LogLevel info
#       File "/var/log/collectd.json.log"
#</Plugin>

<Plugin syslog>
        LogLevel info
</Plugin>
Include "/etc/collectd.d"

この問題を解決する方法の正しい方向を教えてください、またはアドバイスしていただきありがとうございます。

ベストアンサー1

collectd説明書に示すように-f、コマンドラインオプションを使用するか、サービスユニットで(およびno)をType=simple使用する必要があります。Type=notify-fCollectdに含まれるサンプルサービスユニットこれを行います。

おすすめ記事