Guest OS Customization fails with error message 'uncaught signal 15' for Linux
search cancel

Guest OS Customization fails with error message 'uncaught signal 15' for Linux

book

Article ID: 320690

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
The customized Linux VM fails to get expected network configuration, by checking file /var/log/vmware-imc/toolsDeployPkg.log in the customized Linux VM, below error messages can be found:
"[Timestamp][   error] Process exited abnormally after 0 sec, uncaught signal 15"
"..."
"[Timestamp][   error] Failed to reboot, telinit returned error 127."

Cause

The customization command '/sbin/telinit' exits abnormally due to SIGTERM is sent by systemd where telinit is a soft (symbolic) link to systemctl, this causes VM fails to reboot and apply network configuration successfully.

Resolution

This issue has been fixed in VMware Tools version 11.3.5, please upgrade VMware Tools version in template/source VM.

Workaround:
For vSphere 7.0 or later version and VMware Tools version cannot get upgraded to 11.3.5 in template/source VM, please follow below steps:

1. Enable customization script on template/source VM follow KB: https://knowledge.broadcom.com/external/article/313048

2. Modify customization specification to include below customization script which helps to reboot VM after customization.
   #!/bin/sh
   if [ x$1 == x"postcustomization" ]; then
      echo "rebooting" > /var/log/vmware-imc/script.log
      systemctl reboot
   fi

3. Apply above customization specification for customization task.

For vSphere 6.x or older version and VMware Tools version cannot get upgraded to 11.3.5 in template/source VM, please follow below steps to edit template/source VM:

1. Create file /etc/systemd/system/rebootvm.service with below content

[Unit]
Description=Reboot VM if uncaught signal 15
[Service]
Type=simple
ExecStart=timeout 180s /rebootvm.sh
[Install]
WantedBy=multi-user.target

2. Create a shell script at /rebootvm.sh with below content

#!/bin/bash
goscLogFile=/var/log/vmware-imc/toolsDeployPkg.log
while true; do
   isRebootFailed=$(grep -E 'Failed to reboot' "$goscLogFile")
   if [ ! -z "$isRebootFailed" ]; then
      isUncaughtSignal15=$(grep -E 'uncaught signal 15' "$goscLogFile")
      if [ ! -z "$isUncaughtSignal15" ]; then
         systemctl disable rebootvm.service
         rm -rf /etc/systemd/system/rebootvm.service
         systemctl reboot
      fi
   fi
   sleep 1
done

3. Delete file /var/log/vmware-imc/toolsDeployPkg.log if it exists
4. Enable rebootvm.service with below commands
   $(sudo) chmod +x /rebootvm.sh
   $(sudo) systemctl enable rebootvm.service

5. Power-off template/source VM and then it's ready for customization task.