emyl / vagrant-triggers

Allow the definition of arbitrary scripts that will run on the host before and/or after Vagrant commands.
MIT License
546 stars 35 forks source link

Ability to run a process in the background #91

Closed mbarretta closed 6 years ago

mbarretta commented 7 years ago

Was trying something like

config.trigger.after [:up, :resume] do
    run "my_long_running_process.sh &"
end

...expecting the background flag to force the trigger execution to exit, but it continues "Executing command" forever.

daverogers commented 7 years ago

I got one to work like this:

config.trigger.after :up do
    `(vagrant rsync-auto &>/dev/null) &`
end
agriffis commented 6 years ago

This is tricky to do right

It would be better for vagrant-triggers to provide a run_bg command so callers don't have to muddle through the formula