packer-arch/poweroff.timer
Aaron Bull Schaefer 6f747f9425 Add a workaround for the shutdown race condition
http://comments.gmane.org/gmane.linux.arch.general/48739

Basically systemd kills the networking before it kills ssh sessions, and
Packer will try and wait for a 0 exit code after the shutdown command to
confirm that it worked. Things happen too quickly with systemd, and so
Packer complains when gracefully halting the machine that:

    "Build 'vmware' errored: Shutdown command has non-zero exit status."

This workaround just adds a standard systemd timer to the poweroff
command so it has a one second delay, which is long enough for the
0 exit code to return and signal a successful graceful halt.
2013-09-26 11:29:28 -07:00

6 lines
80 B
SYSTEMD

[Unit]
Description=Delayed poweroff
[Timer]
OnActiveSec=1
Unit=poweroff.target