Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sidekiq_service_unit_env_vars option to pass Environment variable… #243

Merged
merged 1 commit into from
May 25, 2020

Conversation

Paprikas
Copy link
Contributor

…s to systemd config file.

I'm using RBENV. And this guy requires some variables to run.

Usage example:

SSHKit.config.command_map[:bundler] = "#{fetch(:rbenv_path)}/bin/rbenv exec bundler"
set :sidekiq_service_unit_env_vars, [
  "RBENV_VERSION=#{fetch(:rbenv_ruby)}",
  "RBENV_ROOT=#{fetch(:rbenv_path)}"
]

Now after bundle exec cap production sidekiq:install proper config will be generated.

  ExecStart=/usr/local/rbenv/bin/rbenv exec bundler exec sidekiq -e production....
  Environment=RBENV_VERSION=2.7.1
  Environment=RBENV_ROOT=/usr/local/rbenv

@seuros seuros merged commit 9678376 into seuros:master May 25, 2020
@mrudult
Copy link

mrudult commented Sep 7, 2021

We need this PR too!

In our case, Sidekiq v6 didn't start as it required HOME environment variable to be set to the deploying user's home directory.

So we had to manually add that to the systemd unit file:

Environment="HOME=/home/deploy"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants