Skip to content
New issue

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

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

Already on GitHub? # to your account

Pum5.x : Multi Apps on same server #305

Closed
jules-w2 opened this issue Dec 2, 2020 · 4 comments · Fixed by #308
Closed

Pum5.x : Multi Apps on same server #305

jules-w2 opened this issue Dec 2, 2020 · 4 comments · Fixed by #308

Comments

@jules-w2
Copy link

jules-w2 commented Dec 2, 2020

Hey guys,

I have multiple rails apps on the same server. (everything worked fine with puma 4.x and capistrano-puma4.x)

Now with Puma 5.x, I try to set set :puma_service_unit_name, "puma_#{fetch(:application)}_#{fetch(:stage)}" otherwise the puma.service file of app A overwrites the file of app B when I launch cap production puma:systemd:config.

But i have this error
1: from /Users/jules/.rvm/gems/ruby-2.6.6@wgroupe_production/gems/capistrano3-puma-5.0.1/lib/capistrano/puma.rb:47:in template_puma' /Users/jules/.rvm/gems/ruby-2.6.6@wgroupe_production/gems/capistrano3-puma-5.0.1/lib/capistrano/puma.rb:47:in read': no implicit conversion of nil into String (TypeError)

Screen Shot 2020-12-02 at 11 26 01 AM

Have you an idea ?
Thanks,

@Eric-Guo
Copy link
Contributor

Eric-Guo commented Dec 3, 2020

I also meet this problem, you can unset :puma_service_unit_name first and do the cap production puma:system:config, and then rename the file in the server manually.

After do that deploy at least works.

@bendilley
Copy link
Contributor

This is to do with the lookup in the template_puma method which assumes there's a template somewhere with the name

"#{fetch(:puma_service_unit_name)}.service"

One workaround is to define your project's own template at lib/capistrano/templates/puma.service.erb using a copy of this gem's template (fine, you might want to customise it anyway) and then symlink it for each service name you need (not fine; tedious, in fact, if you have many staging environments). That is a hack when there could just be a separate variable for :puma_service_template_name

@jules-w2
Copy link
Author

jules-w2 commented Dec 4, 2020

thanks @bendilley,
i will try it

bendilley added a commit to skillstream/capistrano-puma that referenced this issue Dec 7, 2020
Rather than having to define a template per staging environment, use
`puma.service` as the template name to lookup.

Fixes seuros#305
@bendilley
Copy link
Contributor

When I looked at other usage of the template_puma method, the from argument being passed-in is always a static value, so I've opened #308 to assume that the template name is always 'puma.service', as I think that would have been the intention.

bendilley added a commit to skillstream/capistrano-puma that referenced this issue Dec 7, 2020
Using a default systemd service name that is consistent with the default
names used in the nginx and monit plugins.

In combination with seuros#308, forms a zero-config
solution to seuros#305
seuros pushed a commit that referenced this issue Dec 7, 2020
Using a default systemd service name that is consistent with the default
names used in the nginx and monit plugins.

In combination with #308, forms a zero-config
solution to #305
dazralsky pushed a commit to dazralsky/capistrano-puma that referenced this issue Aug 21, 2023
Rather than having to define a template per staging environment, use
`puma.service` as the template name to lookup.

Fixes seuros/capistrano-puma#305
dazralsky pushed a commit to dazralsky/capistrano-puma that referenced this issue Aug 21, 2023
Using a default systemd service name that is consistent with the default
names used in the nginx and monit plugins.

In combination with seuros/capistrano-puma#308, forms a zero-config
solution to seuros/capistrano-puma#305
christophervojick119 pushed a commit to christophervojick119/capistrano-puma that referenced this issue Dec 19, 2024
Rather than having to define a template per staging environment, use
`puma.service` as the template name to lookup.

Fixes seuros/capistrano-puma#305
christophervojick119 pushed a commit to christophervojick119/capistrano-puma that referenced this issue Dec 19, 2024
Using a default systemd service name that is consistent with the default
names used in the nginx and monit plugins.

In combination with seuros/capistrano-puma#308, forms a zero-config
solution to seuros/capistrano-puma#305
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants