Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debian package: fix installation issues on systems having systemd installed but not running it as init. #4242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ log_dir=/var/log/opensearch-dashboards
pid_dir=/var/run/opensearch-dashboards

# Reload systemctl daemon
if command -v systemctl > /dev/null; then
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi

# Reload other configs
if command -v systemd-tmpfiles > /dev/null; then
if [ -d /run/systemd/system ]; then
systemd-tmpfiles --create opensearch-dashboards.conf
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set -e
echo "Running OpenSearch-Dashboards Pre-Installation Script"

# Stop existing service
if command -v systemctl >/dev/null && systemctl is-active opensearch-dashboards.service >/dev/null; then
if [ -d /run/systemd/system ] && systemctl is-active opensearch-dashboards.service >/dev/null; then
echo "Stop existing opensearch-dashboards.service"
systemctl --no-reload stop opensearch-dashboards.service
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set -e
echo "Running OpenSearch-Dashboards Pre-Removal Script"

# Stop existing service
if command -v systemctl >/dev/null && systemctl is-active opensearch-dashboards.service >/dev/null; then
if [ -d /run/systemd/system ] >/dev/null && systemctl is-active opensearch-dashboards.service >/dev/null; then
echo "Stop existing opensearch-dashboards.service"
systemctl --no-reload stop opensearch-dashboards.service
fi
Expand Down
6 changes: 3 additions & 3 deletions scripts/pkg/build_templates/opensearch/deb/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ chown -R opensearch.opensearch ${data_dir}
chown -R opensearch.opensearch ${pid_dir}

# Reload systemctl daemon
if command -v systemctl > /dev/null; then
if [ -d /run/systemd/system ] ; then
systemctl daemon-reload
fi

# Reload other configs
if command -v systemctl > /dev/null; then
if [ -d /run/systemd/system ] ; then
systemctl restart systemd-sysctl.service || true
fi

if command -v systemd-tmpfiles > /dev/null; then
if [ -d /run/systemd/system ] ; then
systemd-tmpfiles --create opensearch.conf
fi

Expand Down
4 changes: 2 additions & 2 deletions scripts/pkg/build_templates/opensearch/deb/debian/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ set -e
echo "Running OpenSearch Pre-Installation Script"

# Stop existing service
if command -v systemctl >/dev/null && systemctl is-active opensearch.service >/dev/null; then
if [ -d /run/systemd/system ] && systemctl is-active opensearch.service >/dev/null; then
echo "Stop existing opensearch.service"
systemctl --no-reload stop opensearch.service
fi
if command -v systemctl >/dev/null && systemctl is-active opensearch-performance-analyzer.service >/dev/null; then
if [ -d /run/systemd/system ] && systemctl is-active opensearch-performance-analyzer.service >/dev/null; then
echo "Stop existing opensearch-performance-analyzer.service"
systemctl --no-reload stop opensearch-performance-analyzer.service
fi
Expand Down
4 changes: 2 additions & 2 deletions scripts/pkg/build_templates/opensearch/deb/debian/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ set -e
echo "Running OpenSearch Pre-Removal Script"

# Stop existing service
if command -v systemctl >/dev/null && systemctl is-active opensearch.service >/dev/null; then
if [ -d /run/systemd/system ] && systemctl is-active opensearch.service >/dev/null; then
echo "Stop existing opensearch.service"
systemctl --no-reload stop opensearch.service
fi
if command -v systemctl >/dev/null && systemctl is-active opensearch-performance-analyzer.service >/dev/null; then
if [ -d /run/systemd/system ] && systemctl is-active opensearch-performance-analyzer.service >/dev/null; then
echo "Stop existing opensearch-performance-analyzer.service"
systemctl --no-reload stop opensearch-performance-analyzer.service
fi
Expand Down
Loading