16031 Terminated sudo shutdown -r now

24 views
Skip to first unread message

sasha.meltser

unread,
Aug 5, 2019, 2:06:49 PM8/5/19
to Packer
I am trying to provision CIS CentOS 7 image and its failing when I do basic reboot. Any advice please

{
"type": "shell",
"inline": ["sudo shutdown -r now"],
"expect_disconnect": true
},

Rickard von Essen

unread,
Aug 5, 2019, 4:20:43 PM8/5/19
to packe...@googlegroups.com
How does it fail? Please provide some more context. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/b6312147-84f7-45de-8ffb-5a28f5836c4b%40googlegroups.com.

sasha.meltser

unread,
Aug 5, 2019, 4:31:34 PM8/5/19
to Packer
Thank you  for replying

this is what i see in logs

[1;32m==> googlecompute: Provisioning with shell script: /var/folders/2q/dmvlb7w13fnfh_xlwwrt2ytm0000gn/T/packer-shell683874453

[1;31m==> googlecompute: /tmp/script_9664.sh: line 2: 16050 Terminated              sudo reboot

[1;32m==> googlecompute: Deleting instance...

[0;32m    googlecompute: Instance has been deleted!

[1;32m==> googlecompute: Deleting disk...

[0;32m    googlecompute: Disk has been deleted!

[1;31mBuild 'googlecompute' errored: Script exited with non-zero exit status: 143.Allowed exit codes are: [0]



and this is snippet from json

"provisioners": [
{
"type": "shell",
"scripts": [
"./postscripts/common/disable-ipv6.sh"
   ]
  },
{
"type": "shell",
"inline": ["sudo reboot"],
"expect_disconnect": true
},
{
"type": "shell",
"scripts": [
"./postscripts/common/common.sh",
  "./postscripts/gui/gnome.sh"
   ]
  }

its failing after reboot.

On Monday, August 5, 2019 at 2:20:43 PM UTC-6, Rickard von Essen wrote:
How does it fail? Please provide some more context. 

On Mon, Aug 5, 2019, 20:06 sasha.meltser <sasha....@ucdenver.edu> wrote:
I am trying to provision CIS CentOS 7 image and its failing when I do basic reboot. Any advice please

{
"type": "shell",
"inline": ["sudo shutdown -r now"],
"expect_disconnect": true
},

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packe...@googlegroups.com.

Rickard von Essen

unread,
Aug 5, 2019, 5:02:23 PM8/5/19
to packe...@googlegroups.com
Is there any good reason why you need to reboot a GCE instance during provisioning? 

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/cd54a1ae-16d6-48ca-9d94-7a02e3c6b1a4%40googlegroups.com.

sasha.meltser

unread,
Aug 5, 2019, 5:05:04 PM8/5/19
to Packer
I am disabling IPv6 and running dracut to update kernel and need to reboot so VM don't boot with IPv6 enabled after kernel updated

Rickard von Essen

unread,
Aug 6, 2019, 8:30:11 AM8/6/19
to packe...@googlegroups.com
Most of the time it's not necessary to run a reboot during provisioning, instead just install the updates and disable ipv6 (whatever there can be any reasons to do that). When you start the image created from this build it should start with the new kernel and ipv6 disabled.

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/62c63036-0c9d-4841-b390-fff7442212af%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages