Skip to content

Commit

Permalink
[BUG] Create logs directory before running OpenSearch on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Burck <[email protected]>
  • Loading branch information
burck1 committed Aug 26, 2022
1 parent 1bfabed commit ee72448
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- `opensearch-service.bat start` and `opensearch-service.bat manager` failing to run ([#4289](https://github.com/opensearch-project/OpenSearch/pull/4289))
- PR reference to checkout code for changelog verifier ([#4296](https://github.com/opensearch-project/OpenSearch/pull/4296))
- `opensearch.bat` and `opensearch-service.bat install && opensearch-service.bat start` failing to run, missing logs directory ([#TODO](TODO))

### Security

Expand Down
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 ee72448

Please sign in to comment.