问题
How can I run sidekiq as daemon on Ubuntu?
If I run bundle exec sidekiq -D
I get invalid option: -D
, is there any way to run it without some other controller, like god, upstart...?
回答1:
there's an option to Daemonize sidekiq, just pass -d
option
commit
回答2:
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
.
回答3:
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
来源:https://stackoverflow.com/questions/15520676/run-sidekiq-as-daemon-on-ubuntu