ubuntu 22.04
rails 7
rbenv
sidekiq 6+
This is the system service
# /lib/systemd/system/sidekiq.service
[Unit]
Description=sidekiq
After=syslog.target network.target
[Service]
Type=simple'User=deploy
Group=deploy
UMask=0002
WorkingDirectory=/home/deploy/current
ExecStart=/bin/bash -lc 'exec /home/deploy/.rbenv/shims/bundle exec sidekiq -e test'
Environment=MALLOC_ARENA_MAX=2
# if we crash, restart
RestartSec=1
Restart=on-failure
# output goes to /var/log/syslog
StandardOutput=syslog
StandardError=syslog
# This will default to "bundler" if we don't specify it
SyslogIdentifier=sidekiq
[Install]
WantedBy=multi-user.target
I have some questions:
Is the -e test (or whatever environment I have) needed in /lib/systemd/system/sidekiq.service?
On my sever, I have a deployment script, and in it, I have:
bundle exec sidekiq &
Is this all I need to make it run in the background? The RAILS_ENV is set in the /home/deploy/.bashrc
Can I make the output go somewhere else, for instance:
StandardOutput=sidekiq StandardError=sidekiq.error
or even:
StandardOutput=/home/deploy/log/sidekiq StandardError=/home/deploy/log/sidekiq.error