Skip to content

Commit

Permalink
Add support for homedir (#69)
Browse files Browse the repository at this point in the history
Closes #67
  • Loading branch information
phvalguima authored Jun 26, 2024
1 parent 3100049 commit 7e2bbda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion snap/hooks/install
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function create_file_structure () {
mkdir -p "${OPENSEARCH_PATH_CONF}/"
copy_files_between_folder "${SNAP}/etc/opensearch/" "${OPENSEARCH_PATH_CONF}/"

declare -a folders=("${OPENSEARCH_HOME}" "${OPENSEARCH_VARLIB}" "${OPENSEARCH_VARLOG}" "${OPENSEARCH_TMPDIR}" "${OPENSEARCH_PATH_CERTS}")
declare -a folders=("${OPENSEARCH_HOME}" "${OPENSEARCH_VARLIB}" "${OPENSEARCH_VARLOG}" "${OPENSEARCH_TMPDIR}" "${OPENSEARCH_PATH_CERTS}" "${HOME}")
for f in "${folders[@]}"; do
if [ ! -d "${f}" ]; then
add_folder "${f}" 770
Expand All @@ -41,6 +41,7 @@ function set_base_config_props () {
set_yaml_prop "${OPENSEARCH_PATH_CONF}/opensearch.yml" "path.home" "${OPENSEARCH_HOME}"

replace_in_file "${OPENSEARCH_PATH_CONF}/jvm.options" "=logs/" "=${OPENSEARCH_VARLOG}/"
echo "-Duser.home=${HOME}" | tee -a "${OPENSEARCH_PATH_CONF}/jvm.options"
}


Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ environment:
SNAP_DATA_CURRENT: /var/snap/opensearch/current
JAVA_HOME: ${SNAP}/usr/lib/jvm/java-21-openjdk-amd64
PATH: ${JAVA_HOME}/jre/bin:$PATH
HOME: ${SNAP_COMMON}/home/snap_daemon

SNAP_LOG_DIR: ${SNAP_COMMON}/ops/snap/logs

Expand Down Expand Up @@ -89,7 +90,6 @@ apps:
command: opt/opensearch/start.sh
restart-condition: always
restart-delay: 20s
# reload-command: ${SNAP}/usr/share/ops/start.sh
plugs:
- network
- network-bind
Expand Down

0 comments on commit 7e2bbda

Please sign in to comment.