On local server: bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e production
------------------------------------------------------------------------------------------------------------
On live server::
https://www.driftingruby.com/episodes/sidekiq-on-production
Before Login server:
Then run:
1. sudo service redis-server restart
2. sudo apt install redis-server
3. redis-server
pwd
/home/ubuntu/.rvm/gems/ruby-2.7.0/wrappers/
--------------------------------------------
then run this line:
sudo nano /lib/systemd/system/sidekiq.service
--------------------------------------------------------------------
then paste:
------------------------------------------------------------------------------
[Unit]
Description=Sidekiq service
After=syslog.target
After=network.target
[Service]
WorkingDirectory=/home/ubuntu/project_name/
#ExecStart=/opt/sidekiq/sidekiq.sh
ExecStart=/home/ubuntu/.rvm/gems/ruby-2.7.0/wrappers/bundle exec sidekiq -e production
User=ubuntu
#User=webuser
Type=simple
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sidekiq
TimeoutStopSec=120
Restart=always
[Install]
WantedBy=multi-user.target
--------------------------------------------------------------------------------
final step start or restart sidekiq:
sudo service sidekiq start
---------------------------------------------
---------------------------------------------
Sidekiq restart with new updation
ps aux | grep sidekiq
kill -9 <PID>
bundle exec sidekiq -d -L log/sidekiq.log
sudo service redis-server restart
sudo systemctl restart sidekiq
====================================