vector icon indicating copy to clipboard operation
vector copied to clipboard

Want to add background mode option

Open emuesuenu opened this issue 5 years ago • 3 comments

Hello. https://github.com/timberio/vector/pull/4035 It is also related to this pull req, init script doesn't work as expected.

[root@881a6e4cb012 ~]# service vector start
Starting vector: Sep 21 12:06:35.753  INFO vector: Log level "info" is enabled.
Sep 21 12:06:35.758  INFO vector: Loading configs. path=["/etc/vector/vector.toml"]
Sep 21 12:06:35.760  INFO vector: Vector is starting. version="0.10.0" git_version="v0.9.0-377-g0f0311a" released="Wed, 22 Jul 2020 20:01:29 +0000" arch="x86_64"
Sep 21 12:06:35.770  INFO vector::topology: Running healthchecks.
Sep 21 12:06:35.770  INFO vector::topology: Starting source "test"
Sep 21 12:06:35.771  INFO vector::topology: Starting sink "new_relic_logs"
Sep 21 12:06:35.771  INFO vector::topology::builder: Healthcheck: Passed.
Sep 21 12:06:35.771  INFO source{name=test type=file}: vector::sources::file: Starting file server. include=["/var/*/*.log"] exclude=[]
Sep 21 12:06:35.772  WARN source{name=test type=file}:file_server: file_source::file_server: Ignoring file smaller than fingerprint_bytes file="/var/log/yum.log"
Sep 21 12:06:35.772  INFO source{name=test type=file}:file_server: file_source::file_server: Found file to watch. path="/var/test2/test.log" file_position=633
Sep 21 12:06:35.772  INFO source{name=test type=file}:file_server: file_source::file_server: Found file to watch. path="/var/log/zzz.log" file_position=290
Sep 21 12:06:35.772  INFO source{name=test type=file}:file_server: file_source::file_server: Found file to watch. path="/var/log/yyy.log" file_position=466
Sep 21 12:06:35.772  INFO source{name=test type=file}:file_server: file_source::file_server: Found file to watch. path="/var/log/xxx.log" file_position=899

The function daemon in init script should expect the given command to start in background mode, but the vector command only works in foreground mode, so it doesn't seem to work as expected.

It seems that the vector command does not have an option to switch background / foreground, so it would be helpful if you could add it.

emuesuenu avatar Sep 21 '20 12:09 emuesuenu

Hi! Can you please explain how it doesn't work as expected? I just installed the Vector RPM, started the service, stopped it, etc, and it's running fine.

Also what platform is this on? (I assumed a RH-related one given you are referencing daemon functions in #4035 but the RPM uses systemd and hence the init script isn't used)

jamtur01 avatar Sep 21 '20 13:09 jamtur01

Thank you very much for contacting me.

I'm running on a CentOS 6 environment. I set up EC2 on AWS using the official CentOS AMI and installed it manually with wget vector-x86_64-unknown-linux-musl.tar.gz.

The usage scene of init.d is decreasing, but I want to make init.d work because it collects logs even in old distributions.

Older distributions have a default GLIBC of 2.12, so you can't use binaries installed with rpm -i. I've tried various log collectors, but if you can use a statically linked vector with musl, many people will find it very helpful.

emuesuenu avatar Sep 23 '20 12:09 emuesuenu

Thanks for clarifying - we'd welcome a PR for this.

jamtur01 avatar Sep 25 '20 17:09 jamtur01