Search code examples
initializationvagrantubuntu-14.04supervisordupstart

How can I modify init script to make it start after delay or event?


I use supervisor.
I have configuration file that launches a task in a directory that is mounted after some time after system startup (/vagrant/task.sh).

So when system starts, supervisor can't start. I have to run sudo service supervisor start command after the system is loaded and the /vagrant directory is mounted.

How can I add delay to /etc/init.d/supervisor to make it start after delay or event?


Solution

  • I found out a solution (event vagrant-mounted):

    cat << EOF > /etc/init/supervisor-launcher.conf
    description "Supervisor Launcher"
    start on vagrant-mounted
    script
      /usr/sbin/service supervisor start
    end script
    EOF