From 8ea7330b144e526173bac103ac6e2408f7accb72 Mon Sep 17 00:00:00 2001 From: Mihail Radkov Date: Sun, 12 Nov 2023 20:00:05 +0200 Subject: [PATCH] TES-304: Updated GraphDB to read its environment from a file - Moved existing env vars to /etc/graphdb/graphdb.env --- build.pkr.hcl | 1 + files/graphdb-cluster-proxy.service | 2 +- files/graphdb.env | 1 + files/graphdb.service | 4 ++-- files/install_graphdb.sh | 2 ++ 5 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 files/graphdb.env diff --git a/build.pkr.hcl b/build.pkr.hcl index 71d7a4c..361c84e 100644 --- a/build.pkr.hcl +++ b/build.pkr.hcl @@ -5,6 +5,7 @@ build { provisioner "file" { sources = [ + "./files/graphdb.env", "./files/graphdb.service", "./files/graphdb-cluster-proxy.service", "./files/install_graphdb.sh" diff --git a/files/graphdb-cluster-proxy.service b/files/graphdb-cluster-proxy.service index f93f417..c0dd19c 100644 --- a/files/graphdb-cluster-proxy.service +++ b/files/graphdb-cluster-proxy.service @@ -14,4 +14,4 @@ TimeoutSec=120 SuccessExitStatus=143 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/files/graphdb.env b/files/graphdb.env new file mode 100644 index 0000000..9fd428f --- /dev/null +++ b/files/graphdb.env @@ -0,0 +1 @@ +GDB_JAVA_OPTS="-Dgraphdb.home=/var/opt/graphdb/node -Dgraphdb.home.conf=/etc/graphdb -Dhttp.socket.keepalive=true -XX:MaxRAMPercentage=85.0 -XX:-UseCompressedOops" diff --git a/files/graphdb.service b/files/graphdb.service index b76ebe6..6b9dd32 100644 --- a/files/graphdb.service +++ b/files/graphdb.service @@ -8,10 +8,10 @@ Restart=on-failure RestartSec=5s User=graphdb Group=graphdb -Environment="GDB_JAVA_OPTS=-Dgraphdb.home=/var/opt/graphdb/node -Dgraphdb.home.conf=/etc/graphdb -Dhttp.socket.keepalive=true -XX:MaxRAMPercentage=85.0 -XX:-UseCompressedOops" +EnvironmentFile="/etc/graphdb/graphdb.env" ExecStart="/opt/graphdb/bin/graphdb" TimeoutSec=120 SuccessExitStatus=143 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/files/install_graphdb.sh b/files/install_graphdb.sh index f994b60..e3b1b54 100644 --- a/files/install_graphdb.sh +++ b/files/install_graphdb.sh @@ -34,6 +34,8 @@ rm graphdb-"${GRAPHDB_VERSION}"-dist.zip mv graphdb-"${GRAPHDB_VERSION}" /opt/graphdb-"${GRAPHDB_VERSION}" ln -s /opt/graphdb-"${GRAPHDB_VERSION}" /opt/graphdb +mv /tmp/graphdb.env /etc/graphdb/graphdb.env + chown -R graphdb:graphdb /etc/graphdb \ /etc/graphdb-cluster-proxy \ /opt/graphdb \