When deploying, we get this error message:
In short, the problem is in the new version 6 policy:
Remove the daemonization, logfile and pidfile command line arguments.
I’ve noted for years
how modern services should be managed with a proper init system.
Managing services manually is more error-prone, let your operating system do it for you. See the Deployment wiki page for options.
If earlier gem controlled daemonizing sidekiq itself, now basic functionality of the OS, for example, systemd in Ubuntu should be engaged in this activity.
Test system:
Ubuntu 18.04.4 LTS
rvm 1.29.9
rails 5.2.3
sidekiq 6.0.4
capistrano-sidekiq 1.0.2
There are 2 ways to solve this problem:
Next, we will discuss option 2.
As an example, on a production server we work as deployer user, so you need to place the service code here:
After that we perform:
So that the service starts when the server starts.
We need to append these lines to project/config/deploy.rb config:
That’s all, now capistrano can control sidekiq.
To run the service manually, we execute such a command on a production server:
or on a server where capistrano is running:
You can view the service log on the server by running:
Notes:
You may want to place the service system-wise in:
but in this case you will have to perform the following:
I do not get the point of it.
It’s better to use /home/%user%/.config/systemd/user/
You can follow any responses to this entry through the RSS 2.0 feed.
Leave a reply