Skip to content

Commit

Permalink
Automatic Service Restart (Debian) (#4530)
Browse files Browse the repository at this point in the history
Signed-off-by: wieso-itzi <wieso-itzi@github.local>
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
Co-authored-by: wieso-itzi <wieso-itzi@github.local>
Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
3 people authored Mar 18, 2024
1 parent b639507 commit cf8508d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,21 @@ if command -v systemd-tmpfiles > /dev/null; then
systemd-tmpfiles --create opensearch-dashboards.conf
fi

# Messages
echo "### NOT starting on installation, please execute the following statements to configure opensearch-dashboards service to start automatically using systemd"
echo " sudo systemctl daemon-reload"
echo " sudo systemctl enable opensearch-dashboards.service"
echo "### You can start opensearch-dashboards service by executing"
echo " sudo systemctl start opensearch-dashboards.service"
# Restart the service after an upgrade
if [ "$1" = "configure" ] && [ -n "$2" ]; then
if command -v systemctl >/dev/null && systemctl is-enabled opensearch-dashboards.service >/dev/null; then
echo "Restarting opensearch-dashboards.service after upgrade"
systemctl start opensearch-dashboards.service
fi
else
# Messages
echo "### NOT starting on installation, please execute the following statements to configure opensearch-dashboards service to start automatically using systemd"
echo " sudo systemctl daemon-reload"
echo " sudo systemctl enable opensearch-dashboards.service"
echo "### You can start opensearch-dashboards service by executing"
echo " sudo systemctl start opensearch-dashboards.service"
fi

echo "### Upcoming breaking change in packaging"
echo " In a future release of OpenSearch Dashboards, we plan to change the permissions associated with access to installed files"
echo " If you are configuring tools that require read access to the OpenSearch Dashboards configuration files, we recommend you add the user that runs these tools to the 'opensearch-dashboards' group"
Expand Down
33 changes: 23 additions & 10 deletions scripts/pkg/build_templates/current/opensearch/deb/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,30 @@ if command -v systemd-tmpfiles > /dev/null; then
systemd-tmpfiles --create opensearch.conf
fi

# Messages
echo "### NOT starting on installation, please execute the following statements to configure opensearch service to start automatically using systemd"
echo " sudo systemctl daemon-reload"
echo " sudo systemctl enable opensearch.service"
echo "### You can start opensearch service by executing"
echo " sudo systemctl start opensearch.service"

if [ -d ${product_dir}/plugins/opensearch-security ]; then
echo "### Create opensearch demo certificates in ${config_dir}/"
echo " See demo certs creation log in ${log_dir}/install_demo_configuration.log"
# Restart the services after an upgrade
if [ "$1" = "configure" ] && [ -n "$2" ]; then
if command -v systemctl >/dev/null && systemctl is-enabled opensearch.service >/dev/null; then
echo "Restarting opensearch.service after upgrade"
systemctl start opensearch.service
fi
if command -v systemctl >/dev/null && systemctl is-enabled opensearch-performance-analyzer.service >/dev/null; then
echo "Restarting opensearch-performance-analyzer.service after upgrade"
systemctl start opensearch-performance-analyzer.service
fi
else
# Messages
echo "### NOT starting on installation, please execute the following statements to configure opensearch service to start automatically using systemd"
echo " sudo systemctl daemon-reload"
echo " sudo systemctl enable opensearch.service"
echo "### You can start opensearch service by executing"
echo " sudo systemctl start opensearch.service"

if [ -d ${product_dir}/plugins/opensearch-security ]; then
echo "### Create opensearch demo certificates in ${config_dir}/"
echo " See demo certs creation log in ${log_dir}/install_demo_configuration.log"
fi
fi

echo "### Upcoming breaking change in packaging"
echo " In a future release of OpenSearch, we plan to change the permissions associated with access to installed files"
echo " If you are configuring tools that require read access to the OpenSearch configuration files, we recommend you add the user that runs these tools to the 'opensearch' group"
Expand Down

0 comments on commit cf8508d

Please sign in to comment.