How to solve "Active: activating (auto-restart)" when starting collectd.service?

7,800

After "experimenting" I managed to reach a solution and make collectd.service run by editing ExecStart property in my /etc/systemd/system/collectd.service file by setting following value:

ExecStart=/usr/sbin/collectd -C /etc/collectd.conf -f

...found at this link.

Hope that helps if someone gets in this kind of situation. :)
Cheers!

Share:
7,800
NikolaS
Author by

NikolaS

Full-stack baby!

Updated on September 18, 2022

Comments

  • NikolaS
    NikolaS almost 2 years

    I have problem with starting collectd.serivce in my Fedora 31 64-bit OS which I've installed via sudo dnf install collectd command. When I type sudo systemctl status collectd.service I get following output:

        ● 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
    

    BTW, I've had to manually create collectd.service file which is located in /etc/systemd/system/ directory. What is really weird is I keep receiving activating (auto-restart) status=0/SUCCESS in above mentioned output. I also performed following commands in respective order:

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

    ...but nothing changed and I've tried restarting my computer after all that and performing all mentioned 1)-3) steps and nothing helped. BTW, this is my 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
    

    This is how my /etc/collectd.conf file looks like:

    #
    # 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"
    

    UPDATE1:

    Here is output of /var/log/error_syslog log file (set in collectd.conf file) that I get:

    [2020-09-20 11:04:25] plugin_dispatch_values: No write callback has been registered. Please load at least one output plugin, if you want the collected data to be stored.
    [2020-09-20 11:04:25] Filter subsystem: Built-in target `write': Dispatching value to all write plugins failed with status 2 (ENOENT). Most likely this means you didn't load any write plugins.
    [2020-09-20 11:04:25] Available write targets:: [none]
    [2020-09-20 11:04:25] Available write targets:: [none]
    [2020-09-20 11:04:25] Available write targets:: [none]
    [2020-09-20 11:04:25] Available write targets:: [none]
    [2020-09-20 11:04:25] Available write targets:: [none]
    [2020-09-20 11:04:25] Available write targets:: [none]
    [2020-09-20 11:04:25] collectd: Stopping 5 write threads.
    [2020-09-20 11:04:35] plugin_load: plugin "cpu" successfully loaded.
    [2020-09-20 11:04:35] plugin_load: plugin "memory" successfully loaded.
    [2020-09-20 11:04:35] Initialization complete, entering read-loop.
    [2020-09-20 11:04:35] Exiting normally.
    [2020-09-20 11:04:35] plugin_dispatch_values: No write callback has been registered. Please load at least one output plugin, if you want the collected data to be stored.
    [2020-09-20 11:04:35] collectd: Stopping 5 read threads.
    [2020-09-20 11:04:35] Filter subsystem: Built-in target `write': Dispatching value to all write plugins failed with status 2 (ENOENT). Most likely this means you didn't load any write plugins.
    [2020-09-20 11:04:35] Available write targets:: [none]
    [2020-09-20 11:04:35] Available write targets:: [none]
    [2020-09-20 11:04:35] Available write targets:: [none]
    [2020-09-20 11:04:35] Available write targets:: [none]
    [2020-09-20 11:04:35] Available write targets:: [none]
    [2020-09-20 11:04:35] Available write targets:: [none]
    [2020-09-20 11:04:35] collectd: Stopping 5 write threads.
    

    Any suggestion/pointing me in right direction how to solve this problem is greatly appreciated.

    • Admin
      Admin almost 4 years
      Check collectd's own log to find out why it is exiting.
    • Admin
      Admin almost 4 years
      Hi Michael, is there any specific command for doing that? Also, where should it (log) be (usually) located? Thanks in advance.
    • Admin
      Admin almost 4 years
      The log ought to be where you specified it in the configuration file you posted.
    • Admin
      Admin almost 4 years
      Michael, I've updated my question with UPDATE1 section which contains output of collectd's log file. Please take a look. Thank you.