bundle exec sidekiq to run it as a daemon we use the -d option
bundle exec sidekiq -dTo kill a sidekiq daemon, you need to do the PID of the sidekiq process. When a sidekiq process starts it enters its pid to file which can be found at
/path/to/rails/app/tmp/pid/sidekiq.pidSo the command to stop it would be
pkill -F /path/to/rails/app/tmp/pid/sidekiq.pidBut making it a daemon is not a good idea, as there is no code from sidekiq to restart the process when it fails or exits on its own. So in ubuntu, which is our favorite OS for the production server, we make sidekiq a systemd process. Before we make it into a service and if you are using rvm you need to create a wrapper for systemd so that ruby with all the gems are available for it.
rvm wrapper 2.3.1 systemd bundleOnce that is done you need to create a sidekiq.service file under your ‘/etc/systemd/system/‘. You can find the configuration file with default settings here. So that was a bit from me on Sidekiq.Hope it helps you some way in further understanding sidekiq.]]>