Sidekiq: Systemd production

Created on 6 Jan 2017  ·  17Comments  ·  Source: mperham/sidekiq

Ruby version:2.3.3
Sidekiq / Pro / Enterprise version(s):4.2.7
same like in
https://github.com/mperham/sidekiq/issues/3252

now starts for develop but same error like in 3252 for production (-e production)

Most helpful comment

I have the same issue and solved it by using sth like
ExecStart=/home/deploy/.rvm/gems/ruby-2.3.3/wrappers/bundle exec sidekiq -e production -C config/sidekiq.yml

Note that I change bin to wrappers

All 17 comments

Post your config/sidekiq.yml. Likely because you have daemonize: true.

sidekiq.yml

:verbose: false
:concurrency: 10
:pidfile: tmp/pids/sidekiq.pid

production:
  :concurrency: 25

`

I've tested it with ubuntu 16.04 and 16.10. Another project but same linux systemd configuration. Again service stopped after 2 sec in production. I'd be grateful if you write me the solution. It works from terminal perfectly.

Show us your sidekiq.service file.

On Jan 7, 2017, at 09:51, Ala notifications@github.com wrote:

sidekiq.yml
`:verbose: false
:concurrency: 10
:pidfile: tmp/pids/sidekiq.pid

production:
:concurrency: 25
`


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

service:

[Unit]
Description=discourse sidekiq service
After=syslog.target network.target

[Service]
Type=simple
WorkingDirectory=/home/alice/ror/testside/
ExecStart=/home/alice/.rvm/bin/systemd_bundle exec sidekiq -e production -C config/sidekiq.yml

User=alice
Group=alice
UMask=0002
Restart=on-failure
RestartSec=10
StandardError=syslog

[Install]
WantedBy=multi-user.target

console:

alice@alice-X550JK:~$ sudo systemctl status sidekiq
● sidekiq.service - discourse sidekiq service
   Loaded: loaded (/etc/systemd/system/sidekiq.service; enabled; vendor preset: 
   Active: active (running) since sob 2017-01-07 20:53:41 CET; 160ms ago
 Main PID: 11440 (ruby)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/sidekiq.service
           └─11440 ruby /home/alice/.rvm/gems/ruby-2.3.3/bin/bundle exec sideki

sty 07 20:53:41 alice-X550JK systemd[1]: Started discourse sidekiq service.

[10]+  Stopped                 sudo systemctl status sidekiq
alice@alice-X550JK:~$ sudo systemctl status sidekiq
● sidekiq.service - discourse sidekiq service
   Loaded: loaded (/etc/systemd/system/sidekiq.service; enabled; vendor preset: 
   Active: activating (auto-restart) (Result: exit-code) since sob 2017-01-07 20
  Process: 11440 ExecStart=/home/alice/.rvm/bin/systemd_bundle exec sidekiq -e 
 Main PID: 11440 (code=exited, status=1/FAILURE)

sty 07 20:53:41 alice-X550JK systemd[1]: sidekiq.service: Unit entered failed s
sty 07 20:53:41 alice-X550JK systemd[1]: sidekiq.service: Failed with result 'e

What happens when you run /home/alice/.rvm/bin/systemd_bundle exec sidekiq -e production -C config/sidekiq.yml manually?

i was trying to set path without wrapper but it didnt help.
And this one :
/home/alice/.rvm/bin/systemd_bundle exec sidekiq
works for me but of course for development only.

I don't understand.

i did wrapper to take control over ruby version:
rvm wrapper 2.3.3 systemd bundle

You aren't answering my question.

What happens when you run /home/alice/.rvm/bin/systemd_bundle exec sidekiq -e production -C config/sidekiq.yml manually? What's the output?

im sorry, here you are:

alice@alice-X550JK:~/ror/testside$ /home/alice/.rvm/bin/systemd_bundle exec sidekiq -e production -C config/sidekiq.yml
[DEPRECATION] requiring "RMagick" is deprecated. Use "rmagick" instead
2017-01-07T21:29:35.223Z 17533 TID-gsj768rtk INFO: Running in ruby 2.3.3-p222 (2016-11-15 revision 56796) [x86_64-linux]
2017-01-07T21:29:35.224Z 17533 TID-gsj768rtk INFO: See LICENSE and the LGPL-3.0 for licensing details.
2017-01-07T21:29:35.224Z 17533 TID-gsj768rtk INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
2017-01-07T21:29:35.224Z 17533 TID-gsj768rtk INFO: Booting Sidekiq 4.2.7 with redis options {:url=>nil}
2017-01-07T21:29:35.224Z 17533 TID-gsj768rtk INFO: Starting processing, hit Ctrl-C to stop

Looks like it works fine when you start it manually. My guess is that you didn't tell systemd to reload the .service file after editing it, using sudo systemctl daemon-reload.

i did it many times

I have no more advice, good luck.

thx

I have the same issue and solved it by using sth like
ExecStart=/home/deploy/.rvm/gems/ruby-2.3.3/wrappers/bundle exec sidekiq -e production -C config/sidekiq.yml

Note that I change bin to wrappers

I have the same issue and solved it by using sth like
ExecStart=/home/deploy/.rvm/gems/ruby-2.3.3/wrappers/bundle exec sidekiq -e production -C config/sidekiq.yml

Note that I change bin to wrappers

Thanks nhannguyen, I manage to solve it.

I have the same issue and solved it by using sth like
ExecStart=/home/deploy/.rvm/gems/ruby-2.3.3/wrappers/bundle exec sidekiq -e production -C config/sidekiq.yml

Note that I change bin to wrappers

Thanks, @nhannguyen, this helped me a lot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aglushkov picture aglushkov  ·  3Comments

rajcybage picture rajcybage  ·  3Comments

michaeldiscala picture michaeldiscala  ·  4Comments

mperham picture mperham  ·  4Comments

HenleyChiu picture HenleyChiu  ·  4Comments