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

cap env sidekiq:uninstall fails with systemd when used does not have sudo permission #307

Open
legendetm opened this issue Jul 26, 2022 · 2 comments

Comments

@legendetm
Copy link

Currently the service file is always removed with sudo, but when sudo is not allowed for the user, then the uninstall fails.

The source code deletes with command execute :sudo, :rm, '-f'

I expect the service file to deleted or to have configuration whether to use sudo or not.

@legendetm legendetm changed the title cap env sidekiq:uninstall fails when used does not have sudo permission cap env sidekiq:uninstall fails with systemd when used does not have sudo permission Jul 26, 2022
@legendetm
Copy link
Author

When following current style, then the code probably should be

execute_array =
  if fetch(:sidekiq_service_unit_user) == :system
    [:sudo, :rm]
  else
    [:rm]
  end
execute *execute_array, '-f', File.join(
  fetch(:service_unit_path, git_plugin.fetch_systemd_unit_path),
  git_plugin.sidekiq_service_file_name
)

@seuros
Copy link
Owner

seuros commented Oct 8, 2022

Can you try with https://rubygems.org/gems/capistrano-sidekiq/versions/3.0.0.alpha.1 ? The new api is now in sync with capistrano3-puma gem.

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

No branches or pull requests

2 participants