bash – How can I figure out why my sidekiq service is failing?

I have an ansible playbook which installs sidekiq. Specifically, I’m using thermistor.sidekiq from ansible-galaxy.

The role seems to install correctly:

TASK (thermistor.sidekiq : Install the sidekiq.service file) ***************************************************************************************
ok: (xx.xx.xx.xx)

TASK (thermistor.sidekiq : Ensure systemd is reloaded if sidekiq.service has changed) **************************************************************
skipping: (xx.xx.xx.xx)

TASK (thermistor.sidekiq : Start for first time and enable the sidekiq service) ********************************************************************
ok: (xx.xx.xx.xx)

TASK (thermistor.sidekiq : Install the sudoers file that will allow sidekiq_user to stop/start sidekiq) ********************************************
ok: (xx.xx.xx.xx)

However, it seems that the sidekiq service is not installed correctly: when I deploy with capistrano, the step where sidekiq is stopped crashes because the service is not found.

I logged into my server to debug manually. I’ve found that sudo service sidekiq status indicates a failure:

‚óŹ sidekiq.service - sidekiq
   Loaded: loaded (/etc/systemd/system/sidekiq.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2021-01-27 08:28:50 UTC; 360ms ago
  Process: 22751 ExecStart=/bin/bash -lc exec /home/deploy/.rbenv/shims/bundle exec sidekiq -e production (code=exited, status=1/FAILURE)
 Main PID: 22751 (code=exited, status=1/FAILURE)

I have tested the ExecStart command manually by running:

/home/deploy/.rbenv/shims/bundle exec sidekiq -e production

This command seems to launch sidekiq successfully, and I don’t see any error. However, the full ExecStart command includes /bin/bash -lc exec in front, and when I use this prefix, I see no output at all (because it’s being executed in a new shell). I understand why I don’t see it, but I can’t see how to identify the error message coming from systemctl (status=1/FAILURE).

How can I figure out why systemctl (or capistrano) can’t start this service? Why does the Ansible role think that the service installed correctly?