I tried to try to give more permissions to read and write for the following file /var/log/opensearch/opensearch.log but every time I get the same error.
$ sudo systemctl daemon-reload
$ sudo systemctl enable opensearch.service
Synchronizing state of opensearch.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable opensearch
$ sudo systemctl start opensearch
Job for opensearch.service failed because a timeout was exceeded.
See "systemctl status opensearch.service" and "journalctl -xeu opensearch.service" for details.
$ sudo systemctl status opensearch.service
Γ opensearch.service - OpenSearch
Loaded: loaded (/lib/systemd/system/opensearch.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Tue 2024-02-27 09:45:19 UTC; 8min ago
Docs: https://opensearch.org/
Process: 185867 ExecStart=/usr/share/opensearch/bin/systemd-entrypoint -p ${PID_DIR}/opensearch.pid --quiet (code=ex>
Main PID: 185867 (code=exited, status=143)
CPU: 43.135s
Feb 27 09:44:20 graylog systemd-entrypoint[185867]: at org.opensearch.cli.EnvironmentAwareCommand.execute(Enviro>
Feb 27 09:44:20 graylog systemd-entrypoint[185867]: at org.opensearch.cli.Command.mainWithoutErrorHandling(Comma>
Feb 27 09:44:20 graylog systemd-entrypoint[185867]: at org.opensearch.cli.Command.main(Command.java:101)
Feb 27 09:44:20 graylog systemd-entrypoint[185867]: at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:>
Feb 27 09:44:20 graylog systemd-entrypoint[185867]: at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:>
Feb 27 09:44:20 graylog systemd-entrypoint[185867]: For complete error details, refer to the log at /var/log/opensearch/>
Feb 27 09:45:18 graylog systemd[1]: opensearch.service: start operation timed out. Terminating.
Feb 27 09:45:19 graylog systemd[1]: opensearch.service: Failed with result 'timeout'.
Feb 27 09:45:19 graylog systemd[1]: Failed to start OpenSearch.
Feb 27 09:45:19 graylog systemd[1]: opensearch.service: Consumed 43.135s CPU time.
lines 1-18/18 (END)
$ journalctl -xeu opensearch.service
Feb 28 07:55:45 graylog systemd-entrypoint[371003]: at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]: at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.ja>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]: at org.opensearch.cli.EnvironmentAwareCommand.execute(Enviro>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]: at org.opensearch.cli.Command.mainWithoutErrorHandling(Comma>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]: at org.opensearch.cli.Command.main(Command.java:101)
Feb 28 07:55:45 graylog systemd-entrypoint[371003]: at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]: at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:>
Feb 28 07:55:45 graylog systemd-entrypoint[371003]: For complete error details, refer to the log at /var/log/opensearch/>
Feb 28 07:56:44 graylog systemd[1]: opensearch.service: start operation timed out. Terminating.
Feb 28 07:56:45 graylog systemd[1]: opensearch.service: Failed with result 'timeout'.
ββ Subject: Unit failed
ββ Defined-By: systemd
ββ Support: http://www.ubuntu.com/support
ββ
ββ The unit opensearch.service has entered the 'failed' state with result 'timeout'.
Feb 28 07:56:45 graylog systemd[1]: Failed to start OpenSearch.
ββ Subject: A start job for unit opensearch.service has failed
ββ Defined-By: systemd
ββ Support: http://www.ubuntu.com/support
ββ
ββ A start job for unit opensearch.service has finished with a failure.
ββ
ββ The job identifier is 1018759 and the job result is failed.
Feb 28 07:56:45 graylog systemd[1]: opensearch.service: Consumed 47.640s CPU time.
ββ Subject: Resources consumed by unit runtime
ββ Defined-By: systemd
ββ Support: http://www.ubuntu.com/support
ββ
ββ The unit opensearch.service completed and consumed the indicated resources.
You may need to scroll up on journalctl. Looks like the tail end of the log. If you could show any configurations that would help. How did you install opensearch?
Thanks for help! Following your solution, it got fixed. I really donβt understand how I missed something like that. From now on, Iβll pay attention to everything I write