I want Vagrant to start the Play server in the /vagrant/ folder every time I do vagrant up. Putting @reboot on the crontab doesn't work because the script runs before the /vagrant/ folder is connected.
I want Vagrant to start the Play server in the /vagrant/ folder every time I do vagrant up. Putting @reboot on the crontab doesn't work because the script runs before the /vagrant/ folder is connected.
I found using a seperate vagrant provisioner with the option
run : "always"
a lot easier, eg:config.vm.provision :shell, path: "yourStartUp.sh", run: "always", privileged: false
See https://docs.vagrantup.com/v2/provisioning/shell.html for full doc.
Instead of using crontab, have you tried using Upstart?
Vagrant emits a "vagrant-mounted" event when the shared folder is mounted, so you could create an upstart conf file, say
/etc/init/play.conf
, to run when that event is emitted: