diff --git a/arch-template.json b/arch-template.json index 1726cf9..9bf0a6b 100644 --- a/arch-template.json +++ b/arch-template.json @@ -14,7 +14,7 @@ "disk_size": 20480, "ssh_username": "root", "ssh_password": "vagrant", - "shutdown_command": "systemctl poweroff" + "shutdown_command": "systemctl start poweroff.timer" } ], "post-processors": [ diff --git a/install.sh b/install.sh index 384aa9d..5d0dc92 100644 --- a/install.sh +++ b/install.sh @@ -66,6 +66,8 @@ cat <<-EOF > "${TARGET_DIR}${CONFIG_SCRIPT}" /usr/bin/curl --output /home/vagrant/.ssh/authorized_keys https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub /usr/bin/chown vagrant:users /home/vagrant/.ssh/authorized_keys /usr/bin/chmod 0600 /home/vagrant/.ssh/authorized_keys + # workaround for shutdown race condition: http://comments.gmane.org/gmane.linux.arch.general/48739 + /usr/bin/curl --output /etc/systemd/system/poweroff.timer https://raw.github.com/elasticdog/packer-arch/master/poweroff.timer # clean up /usr/bin/pacman -Rcns --noconfirm gptfdisk diff --git a/poweroff.timer b/poweroff.timer new file mode 100644 index 0000000..2310ffb --- /dev/null +++ b/poweroff.timer @@ -0,0 +1,6 @@ +[Unit] +Description=Delayed poweroff + +[Timer] +OnActiveSec=1 +Unit=poweroff.target