Skip to content

Commit 33372c7

Browse files
authored
fix postinst failure for debian (#1929)
1 parent cce26c8 commit 33372c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packaging/debian/postinst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e
66

77
# restart agent after upgrade
88
if [ "$1" = "configure" ]; then
9-
if [ -x /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl ]; then
9+
if ([ "$(/sbin/init --version 2>/dev/null | grep -c upstart)" = 1 ] || [ "$(systemctl | grep -c -E '\-\.mount\s')" = 1 ]) && [ -x /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl ]; then
1010
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a cond-restart
1111
fi
1212
fi

0 commit comments

Comments
 (0)