Manvendra Singh
Manvendra Singh

Reputation: 21

How to run sidekiq in background

I am using this command

bundle exec sidekiq -d

to run sidekiq server on the background. getting this error message

ERROR: Daemonization mode was removed in Sidekiq 6.0, please use a proper process supervisor to start and manage your services. sidekiq run but not in the background. After closing the console sidekiq automatically close.

Upvotes: 1

Views: 7691

Answers (5)

Perhaps this will be very helpfull for someone

I start Sidekiq with '&' so it should move on to executing the next command, so Sidekiq runs in the background.

examples how I doing it

to run sedekiq and redis-server in background

bundle exec sidekiq & redis-server --daemonize yes

to run sedekiq in background and then rails server

bundle exec sidekiq & rails s

Upvotes: 0

Sagar Kamble
Sagar Kamble

Reputation: 590

It is removed from the latest versions of Sidekiq to promote users to learn the newer, better ways. Here is the link to the discussion on the same.

The discussion suggested using a process supervisor like systemd, upstart, foreman, etc. to manage Sidekiq.

So you need to write your own service file to start, stop sidekiq. For the reference, here is the link to example service of sidekiq.

https://github.com/mperham/sidekiq/blob/master/examples/systemd/sidekiq.service

Upvotes: 1

Neeraj Amoli
Neeraj Amoli

Reputation: 1026

You need to open another terminal tab, in ubuntu ctrl + shift + T and run command

 bundle exec sidekiq start

Upvotes: 1

kurupt_89
kurupt_89

Reputation: 1592

You didn't mention the operating system so I'll just go with ubuntu production VM. You're going to want to setup sidekiq with something like systemd or upstart. Sidekiq has some example configurations to get you started https://github.com/mperham/sidekiq/tree/master/examples.

I haven't done this on a mac before, but a quick google and found this Start sidekiq automatically on OSX.

Upvotes: 0

Konrad Janczyk
Konrad Janczyk

Reputation: 182

You may also think about using process manager like overmind which will help you manage multiple processes (for instance server and sidekiq) https://github.com/DarthSim/overmind

There are other tools around the web, this is my personal choice.

Upvotes: 1

Related Questions