generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Description
Describe the bug
From version v1.3.00060.0, the postinstall script of the debian installer of Amazon Cloud Watch Agent is erroring out saying that the system does not support System V Init
Steps to reproduce
- Create a chroot of Debian 12 or Ubuntu noble.
- Download the latest version of amazon-cloudwatch-agent.deb (v1.300060.0)
- Inside chroot, do dpkg -i amazon-cloudwatch-agent.deb
- Installer will fail in Post Install saying 'sysv-init is not supported'
What did you expect to see?
- Installation must go through without erroring out.
- The chroot'ed environment does have systemctl.
What did you see instead?
- Installer will fail in Post Install saying 'sysv-init is not supported'
What version did you use?
Version: v.1.300060.0
What config did you use?
Config: N/A
Environment
OS: Ubuntu 24.04
Additional context
- postinstall script calls amazon-cloudwatch-agent-ctl
- Code in amazon-cloudwatch-agent-ctl that checks for Sysv-Init is incorrect and will not work in chroot'ed environments. systemctl command (Line 391) will always fail inside a chroot'ed environment.
Code snippet below (Commit #da27bf33f)
388 # detect which init system is in use
389 if [ "$(/sbin/init --version 2>/dev/null | grep -c upstart)" = 1 ]; then
390 SYSTEMD='false'
391 elif [ "$(systemctl | grep -c -E '\-\.mount\s')" = 1 ]; then
392 SYSTEMD='true'
393 elif [ -f /etc/init.d/cron ] && [ ! -h /etc/init.d/cron ]; then
394 echo "sysv-init is not supported" >&2
395 exit 1
396 else
397 echo "unknown init system" >&2
398 exit 1
399 fi
Metadata
Metadata
Assignees
Labels
No labels