Starting filebeat from java code - filebeat service exit when the java service is closed


I'm trying to start filebeat from java code using:

Runtime.getRuntime().exec("service filebeat start")

The filebeat start successfully but when I kill the java process it also exit

I tried:

nohup sudo service filebeat start &

also check using ps aux and doesn't seems the filebeat is NOT a child of the java process

filebeat log:

2020-05-04T14:53:07.641+0300    DEBUG   [service]       service/service.go:53   Received sigterm/sigint, stopping
2020-05-04T14:53:07.641+0300    INFO    beater/filebeat.go:443  Stopping filebeat
2020-05-04T14:53:07.641+0300    INFO    crawler/crawler.go:139  Stopping Crawler
2020-05-04T14:53:07.641+0300    INFO    crawler/crawler.go:149  Stopping 1 inputs
2020-05-04T14:53:07.641+0300    INFO    input/input.go:149      input ticker stopped
2020-05-04T14:53:07.641+0300    INFO    input/input.go:167      Stopping Input: 11406884408552407199

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.