0

I have installed td-agent and they provide an init.d script that you can run it with, I have configured td-agent and I run it via the init.d script and it's running smoothly, but I want to move td-agent to be running under Supervisor, I have reread and updated supervisor and my conf of fluentd looks like this.

[program:fluentd]
command=/etc/init.d/td-agent start
stopasgroup=true
stopsignal=QUIT

but when I run this program sudo supervisortctl start fluentd I got this error.

$ sudo supervisorctl restart fluentd
fluentd: ERROR (spawn error)

and supervisor program log

/tmp/fluentd-stdout---supervisor-Sdy05R.log <==
Starting td-agent:  * td-agent
Starting td-agent:  * td-agent
Starting td-agent:  * td-agent
$ sudo supervisorctl status fluentd
fluentd                          FATAL     Exited too quickly (process log may have details)

but when I search if there any process that are running with td-agent I found this

$ sudo ps aux | grep td-agent
td-agent 16594  0.0  0.0 127080 20860 ?        Sl   09:49   0:00 /opt/td-agent/embedded/bin/ruby /usr/sbin/td-agent --log /var/log/td-agent/td-agent.log --daemon /var/run/td-agent/td-agent.pid
td-agent 16599  1.0  0.0 139560 29508 ?        Sl   09:49   0:01 /opt/td-agent/embedded/bin/ruby -Eascii-8bit:ascii-8bit /usr/sbin/td-agent --log /var/log/td-agent/td-agent.log --daemon /var/run/td-agent/td-agent.pid --under-supervisor

so, what I understood is that Supervisor it runs the program fluentd but the init.d script spawn his own process and it didn't notify Supervisor with the new process, so in Supervisor eyes that this init.d script has been terminated?

Any solutions to this?

  • Did you try to not using init.d and starting td-agent directly? Start td-agent with init.d, check with `ps aux` how fluentd/td-agent was started, and try to directly start it with supervisord. Eventually a backgrounding/forking/daemon flag needs to be removed from the fluents options. – hargut Feb 21 '19 at 19:08
  • @hargut thanks so much, I removed `--daemon` flag and add it to supervisor.conf and it works now, btw I have the same issue with running a nodejs http server under Supervisor the same behavior occurs, stopping the supervisor nodejs process doesn't shutdown the nodejs process, how you think I can fix this ? – Iliyass Hamza Feb 22 '19 at 08:22

0 Answers0