Skip to content

Commit e91b7e7

Browse files
authored
Check that run under systemd (#45)
1 parent e45cbf5 commit e91b7e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

debian/DEBIAN/postinst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22
set -ex
33
systemctl enable nebius_observability_agent_updater.service
4-
5-
systemctl restart nebius_observability_agent_updater.service
6-
4+
if [ "$(systemctl is-system-running)" != "offline" ]; then # Check if running under systemd
5+
systemctl restart nebius_observability_agent_updater.service
6+
fi
77
mkdir -p /var/lib/nebius-observability-agent-updater
88

99
chmod 0640 /etc/nebius-observability-agent-updater/config.yaml

0 commit comments

Comments
 (0)