ansible/roles/resque/templates/resque-systemd.service in subspace-2.5.10 vs ansible/roles/resque/templates/resque-systemd.service in subspace-3.0.0.rc1
- old
+ new
@@ -13,15 +13,17 @@
#
[Service]
#
# !!!! !!!! !!!!
#
-Type=simple
+Type=forking
WorkingDirectory=/u/apps/{{project_name}}/current
-ExecStart="RAILS_ENV={{rails_env}} COUNT={{resque_concurrency}} QUEUES={{hostname}},{{ job_queues | join(',') }} BACKGROUND=yes PIDFILE=/u/apps/{{project_name}}/shared/tmp/pids/resque.pid bundle exec rake resque:work"
+ExecStart=/usr/local/bin/bundle exec rake resque:work
+ExecStop=/bin/kill -s QUIT $MAINPID
+PIDFile=/u/apps/{{project_name}}/shared/tmp/pids/resque.pid
# Uncomment this if you are going to use this as a system service
# if using as a user service then leave commented out, or you will get an error trying to start the service
# !!! Change this to your deploy user account if you are using this as a system service !!!
User=deploy
@@ -29,10 +31,15 @@
UMask=0002
# Greatly reduce Ruby memory fragmentation and heap usage
# https://www.mikeperham.com/2018/04/25/taming-rails-memory-bloat/
Environment=MALLOC_ARENA_MAX=2
+Environment=RAILS_ENV={{rails_env}}
+Environment=COUNT=1
+Environment=QUEUES={{ job_queues | join(',') }}
+Environment=BACKGROUND=yes
+Environment=PIDFILE=/u/apps/{{project_name}}/shared/tmp/pids/resque.pid
# if we crash, restart
RestartSec=1
Restart=on-failure
@@ -42,6 +49,6 @@
# This will default to "bundler" if we don't specify it
SyslogIdentifier=resque
[Install]
-WantedBy=multi-user.target
\ No newline at end of file
+WantedBy=multi-user.target