Search code examples
laravelubuntusupervisordbeanstalkd

Supervisor won't automatically startup when Ubuntu Server is booted


I'm working on beantalkd and supervisord for my Laravel project with homestead vm. Everytime i vagrant up the homestead vm, the supervisord does not start. I have to manually type below for it to run:

sudo service supervisor start

The version i'm running on is 3.0b2-1. I have also installed rcconf to check which service is started automatically at boot time and supervisor is checked as well.

Another thing that i tried is running crontab to try to start the service. Below is the crontab script i wrote:

@reboot root /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
* * * * * php /home/vagrant/projects/llpm/artisan scheduled:run 1>> /dev/null 2>&1 --env=local

Still it won't automatically start at reboot. Anyone have any solution?


Solution

  • I've found the answer from here.

    Somehow, it's caused by vagrant. So what i did is added this line below to Homestead/scripts/homestead.rb:

    config.vm.provision "shell", inline: "service supervisor restart", run: "always"
    

    Vagrant up and supervisor is booted up as well.