|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright OpenSearch Contributors |
| 4 | +# SPDX-License-Identifier: Apache-2.0 |
| 5 | +# |
| 6 | +# The OpenSearch Contributors require contributions made to |
| 7 | +# this file be licensed under the Apache-2.0 license or a |
| 8 | +# compatible open source license. |
| 9 | + |
| 10 | +# deb opensearch-dashboards postinst script |
| 11 | + |
| 12 | +set -e |
| 13 | + |
| 14 | +echo "Running OpenSearch-Dashboards Post-Installation Script" |
| 15 | + |
| 16 | +product_dir=/usr/share/opensearch-dashboards |
| 17 | +config_dir=/etc/opensearch-dashboards |
| 18 | +data_dir=/var/lib/opensearch-dashboards |
| 19 | +log_dir=/var/log/opensearch-dashboards |
| 20 | +pid_dir=/var/run/opensearch-dashboards |
| 21 | + |
| 22 | +# Reload systemctl daemon |
| 23 | +if command -v systemctl > /dev/null; then |
| 24 | + systemctl daemon-reload |
| 25 | +fi |
| 26 | + |
| 27 | +# Reload other configs |
| 28 | +if command -v systemd-tmpfiles > /dev/null; then |
| 29 | + systemd-tmpfiles --create opensearch-dashboards.conf |
| 30 | +fi |
| 31 | + |
| 32 | +# Messages |
| 33 | +echo "### NOT starting on installation, please execute the following statements to configure opensearch-dashboards service to start automatically using systemd" |
| 34 | +echo " sudo systemctl daemon-reload" |
| 35 | +echo " sudo systemctl enable opensearch-dashboards.service" |
| 36 | +echo "### You can start opensearch-dashboards service by executing" |
| 37 | +echo " sudo systemctl start opensearch-dashboards.service" |
| 38 | +echo "### Upcoming breaking change in packaging" |
| 39 | +echo " In a future release of OpenSearch Dashboards, we plan to change the permissions associated with access to installed files" |
| 40 | +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" |
| 41 | +echo " For more information, see https://github.com/opensearch-project/opensearch-build/pull/4043" |
| 42 | + |
| 43 | +# Set owner |
| 44 | +chown -R opensearch-dashboards.opensearch-dashboards ${product_dir} |
| 45 | +chown -R opensearch-dashboards.opensearch-dashboards ${config_dir} |
| 46 | +chown -R opensearch-dashboards.opensearch-dashboards ${log_dir} |
| 47 | +chown -R opensearch-dashboards.opensearch-dashboards ${data_dir} |
| 48 | +chown -R opensearch-dashboards.opensearch-dashboards ${pid_dir} |
| 49 | + |
| 50 | +exit 0 |
| 51 | + |
| 52 | + |
0 commit comments