bundle exec cap production puma:install produces below block in the service file.
[Service]
Type=simple
WatchdogSec=10
When I deploy my code using bundle exec cap production deploy, it shows below error in journalctl.
Dec 05 22:22:07 blog-rails-deployment-1 systemd[20255]: blog_puma_production.service: Watchdog timeout (limit 10s)!
Dec 05 22:22:07 blog-rails-deployment-1 systemd[20255]: blog_puma_production.service: Killing process 22263 (bundle) with signal SIGABRT.
Dec 05 22:22:07 blog-rails-deployment-1 systemd[20255]: blog_puma_production.service: Killing process 22280 (bundle) with signal SIGABRT.
Dec 05 22:22:07 blog-rails-deployment-1 systemd[20255]: blog_puma_production.service: Killing process 22283 (bundle) with signal SIGABRT.
Dec 05 22:22:07 blog-rails-deployment-1 systemd[20255]: blog_puma_production.service: Main process exited, code=dumped, status=6/ABRT
Dec 05 22:22:07 blog-rails-deployment-1 systemd[20255]: blog_puma_production.service: Failed with result 'watchdog'.
Does WatchdogSec not work with Type=simple? If it doesn't, I think we should add a condition to only add WatchdogSec when service_unit_type is notify. The systemd man page does not specifically say if it will work with Type=simple or not, but it does mention that "The service must call sd_notify(3) regularly with "WATCHDOG=1" (i.e. the "keep-alive ping").". When using Type=simple, sd_notify gem might not be added, is that what is causing the above error?
[Service]
Type=<%= service_unit_type %>
<% if service_unit_type == "notify" %>
WatchdogSec=10
<% end %>
I haven't included
sd_notify
gem in my Gemfile.bundle exec cap production puma:install
produces below block in the service file.When I deploy my code using
bundle exec cap production deploy
, it shows below error injournalctl
.Does
WatchdogSec
not work withType=simple
? If it doesn't, I think we should add a condition to only addWatchdogSec
whenservice_unit_type
isnotify
. The systemd man page does not specifically say if it will work withType=simple
or not, but it does mention that "The service must call sd_notify(3) regularly with "WATCHDOG=1" (i.e. the "keep-alive ping").". When usingType=simple
,sd_notify
gem might not be added, is that what is causing the above error?