fluent / fluentd-docs

This repository is deprecated. Go to fluentd-docs-gitbook repository.
49 stars 119 forks source link

How to use td-agent status command on Amazon Linux 2? #601

Open n-yusuke opened 5 years ago

n-yusuke commented 5 years ago

Context

I'm installing td-agent on Amazon Linux 2 instance following the official installation guide.

Problem

I can't use sudo /etc/init.d/td-agent status command in Step 2: Launch Daemon of the guide. When I execute sudo /etc/init.d/td-agent status, I get:

[ec2-user@ip-172-17-11-221 etc]$ sudo /etc/init.d/td-agent status
/lib/lsb/init-functions: line 22: /etc/redhat-lsb/lsb_log_message: No such file or directory

because there is not /etc/redhat-lsb directory on the instance. However I can use other commands(start, stop, restart) of td -agent. How can I use td-agent status command on Amazon Linux 2?

fujimotos commented 5 years ago

I think you can resolve the issue by installing redhat-lsb-core. Try something like below on your instance and see if the issue resolved:

$ sudo yum install redhat-lsb-core
n-yusuke commented 5 years ago

I tried that command, but I got this (redhat-lsb-core has already been installed):

[ec2-user@ip-172-17-11-221 ~]$ sudo yum install redhat-lsb-core
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
158 packages excluded due to repository priority protections
Package system-lsb-core-4.1-27.amzn2.3.5.x86_64 already installed and latest version
Nothing to do

So the issue is not resolved yet. The AMI ID is amzn2-ami-hvm-2.0.20181114-x86_64-gp2 (ami-0a2de1c3b415889d2).

fujimotos commented 5 years ago

Interesting. Actually I can confirm the package "redhat-lsb-core" provides /etc/redhat-lsb/lsb_log_message on Redhat (also on CentOS).

$ yum provides /etc/redhat-lsb/lsb_log_message
...
redhat-lsb-core-4.1-27.el7.centos.1.x86_64 : LSB Core module support
Repo        : base
Matched from:
Filename    : /etc/redhat-lsb/lsb_log_message

Can you run the command above (yum provides ...) on your instance and paste the output here?

repeatedly commented 5 years ago

Hmm... Amazon Linux 2 doesn't gurantee the compatiblity with RHEL/CentOS and they focus on systemd based process management. We need to know the differences between RH familiy and Amazon Linux 2...