experience with multiple postinstall scripts?

82 views
Skip to first unread message

Julian Dunn

unread,
Dec 19, 2012, 6:37:03 PM12/19/12
to vee...@googlegroups.com
Does anyone have experience with multiple postinstall scripts?

I tried to set this up in my definition but it didn't work. At the end of the first one, I reboot the VM, and I can see VirtualBox successfully reboots it, but Veewee doesn't seem to ever re-log-in and execute the second. It just hangs.

- Julian

Patrick Debois

unread,
Dec 20, 2012, 3:43:26 AM12/20/12
to vee...@googlegroups.com
On 20/12/12 00:37, Julian Dunn wrote:
> Does anyone have experience with multiple postinstall scripts?
Hi Julian,

multiple postinstall scripts are in use in several templates and they
work as supposed.

https://github.com/jedi4ever/veewee/blob/master/templates/CentOS-6.3-i386-minimal/definition.rb


> I tried to set this up in my definition but it didn't work. At the end
> of the first one, I reboot the VM, and I can see VirtualBox
> successfully reboots it, but Veewee doesn't seem to ever re-log-in and
> execute the second. It just hangs.
I guess the main difference is that you reboot during on of the
postinstalls.

Could you provide me with your definition, so we can check the behavior?

thanks you

Julian Dunn

unread,
Dec 20, 2012, 11:03:17 AM12/20/12
to vee...@googlegroups.com
Thanks Patrick. Here is what I was trying to do (ignore the rest of the diff, you've seen that before in my pull request)

https://github.com/juliandunn/veewee/commit/556609989af246b7d9f5eaa2f05b26ea14ff3168

The reason I'm trying to do this is because a "yum update" in the old postinstall.sh will update the kernel, but VirtualBox's kernel extensions get built against the old kernel.

- Julian

Julian Dunn

unread,
Jan 22, 2013, 2:57:42 PM1/22/13
to vee...@googlegroups.com
Okay. So Patrick, after taking your advice about putting a "service sshd stop && reboot" at the end of the first postinstall script, I came across other interesting behaviour. This is what happens:

https://gist.github.com/4596902

To work around this, I had to rescue for IOError on the outside of the block and move on to the next script, but I recognize this is a pretty awful solution:

https://github.com/juliandunn/veewee/commit/db5022d7723090e08926c486919016892e44b8dc

Thoughts on how I could do this better? It does work though, and I get a box built at the end.

- Julian

Patrick Debois

unread,
Jan 23, 2013, 6:22:24 AM1/23/13
to vee...@googlegroups.com
Hey Julian,

I actually think you're hack is a good solution - I'd be happy to merge it in.

Patrick
--
 
 

Julian Dunn

unread,
Jan 23, 2013, 1:42:22 PM1/23/13
to vee...@googlegroups.com
I'll put in a pull request to veewee. But I really think it's brittle at the moment. Net::SSH should just trap IOError and raise Net::SSH::Disconnect, that way it'd be cleaner and Veewee could trap that outside of the loop as a "normal" condition. I'll file a bug with the Net::SSH folks.

- Julian
Reply all
Reply to author
Forward
0 new messages