Sorry for the long delay in getting back to you on this. I've been bashing my head against the desk and just now figured it out.
The box has a Vagrantfile. That file has 'config.vm.provision "shell', path: "run_at_start.sh"" in it. The Vagrant machine *also* has the same Vagrantfile. Because of the way that Vagrant pulls in the box's Vagrantfile after parsing its own, it now has two (identical) 'config.vm.provision "shell' lines and it decides that I meant to run it twice. I could consider this a bug, but I can also see that "having two identical shell lines means run the command twice" is logical if you squint hard. I have a solution for my use case: remove the shell line from the machine's Vagrantfile. Hopefully this doesn't burn other people or, if it does, that they can find this thread. --Paul Hoffman On Wed, Jun 7, 2017 at 12:30 AM, Alvaro Miranda Aguilera <[email protected]> wrote: > > On Wed, Jun 7, 2017 at 12:02 AM, Paul Hoffman <[email protected]> > wrote: > >> Vagrant.configure("2") do |config| >> config.vm.box = "main" >> config.vm.provision "shell", path: "run_at_start.sh" >> end >> > > Hello > > It shouldn't. > > So I will suggest. > > 1. check with a different box, ie hashicorp/precise64 > > 2. The way Vagrant works, you have 3 Vagrantfiles (if present) and they > get merge in memory. > > So check if there is a Vagrantfile at: > > ~/.vagrant.d/Vagrantfile < this is a global one that will be loaded into > all the commands > > ~/.vagrant.d/boxes/<thebox>/<somepath>/Vagrantfile < this will be used in > all the VMs that use this base box. > > Also you can test with: > > # config.vm.provision "shell", path: "run_at_start.sh" > config.vm.provision "shell", inline: " echo we run run_at_start.sh" > > That will display how many runs will happen. > > If this display only one time, then maybe the script is calling himself? > > There aren't many options. > > > > > -- > Alvaro > > -- > 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/vagrant/issues > IRC: #vagrant on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Vagrant" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/vagrant-up/CAHqq0ezUrhwB7bQtOcdVRjP4Bu2FW2KWVdq%2BvwD3GHXqz1_%2BPg% > 40mail.gmail.com > <https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezUrhwB7bQtOcdVRjP4Bu2FW2KWVdq%2BvwD3GHXqz1_%2BPg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/vagrant/issues IRC: #vagrant on Freenode --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAPik8yYAfr%3DT_JtbK_rc4K0CDhpPOL%3D0DAfJB2QCr%3DDj2RaH0A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
