Search code examples
vagrantvagrantfilevagrant-plugin

Preferred method to daemonize vagrant plugin


Is there a preferred method to daemonize a vagrant plugin?

I am using vagrant-fsnotify which runs a process on the host to send file change events from the host to the guest.


Solution

  • Vagrant plugins have access to Vagrant "Action Hooks" which are useful for extending expected events.

    For example, I could extend the fsnotify functionality to use Daemons for background-processing capabilities. Then, tie into the Vagrant Action Hook up and halt to trigger the start of fsnotify, and trigger the stop of fsnotify.

    Here is a good example vagrant-plugin that uses action-hooks.