Run Sidekiq as daemon on Ubuntu
Running as daemon won't restart the sidekiq
if it crashes unexpectedly. One alternate way could be to run sidekiq as a service (An upstart job). If the system is rebooted than also the upstart job will run sidekiq.Here is the complete script and method to run sidekiq as a service.
After running sidekiq as a service you can simply start/stop/restart
sidekiq by command sudo service sidekiq start/stop/restart
.
As of sidekiq 6.0 Daemonization wouldnt work and if you pass -d, you'll get a message:
Daemonization mode was removed in Sidekiq 6.0, please use a proper process supervisor to start and manage your services
check the issue here #4045