Skip to content

Commit

Permalink
[BUG] Create logs directory before running OpenSearch on Windows (#4305
Browse files Browse the repository at this point in the history
…) (#5473)

* [BUG] Create logs directory before running OpenSearch on Windows

Signed-off-by: Alex Burck <[email protected]>

* update changlog pr link

Signed-off-by: Alex Burck <[email protected]>

Signed-off-by: Alex Burck <[email protected]>
(cherry picked from commit 7ea6e88)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

Signed-off-by: Alex Burck <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent fa38192 commit 5813f36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions distribution/src/bin/opensearch-service.bat
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ exit /B 1
set OPENSEARCH_VERSION=${project.version}

if "%SERVICE_LOG_DIR%" == "" set SERVICE_LOG_DIR=%OPENSEARCH_HOME%\logs
rem The logs directory must exist for the service to start.
if not exist "%SERVICE_LOG_DIR%" (
mkdir "%SERVICE_LOG_DIR%"
)

if "x%1x" == "xx" goto displayUsage
set SERVICE_CMD=%1
Expand Down
6 changes: 6 additions & 0 deletions distribution/src/bin/opensearch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ IF ERRORLEVEL 1 (
EXIT /B %ERRORLEVEL%
)

if "%SERVICE_LOG_DIR%" == "" set SERVICE_LOG_DIR=%OPENSEARCH_HOME%\logs
rem The logs directory must exist for the service to start.
if not exist "%SERVICE_LOG_DIR%" (
mkdir "%SERVICE_LOG_DIR%"
)

SET KEYSTORE_PASSWORD=
IF "%checkpassword%"=="Y" (
CALL "%~dp0opensearch-keystore.bat" has-passwd --silent
Expand Down

0 comments on commit 5813f36

Please sign in to comment.