forked from codeur/capistrano-solid_queue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolid_queue.service.erb
More file actions
27 lines (22 loc) · 896 Bytes
/
solid_queue.service.erb
File metadata and controls
27 lines (22 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[Unit]
Description=SolidQueue background job
After=syslog.target network.target
[Service]
Type=simple
Environment='RAILS_ENV=<%= fetch(:stage) %>'
<% fetch(:default_env).reject{ |k, _| k.to_s == 'path' }.each do |variable, value| -%>
Environment='<%= variable.to_s.upcase %>=<%= value.to_s %>'
<% end -%>
WorkingDirectory=<%= current_path %>
ExecStart=<%= capture(:echo, SSHKit.config.command_map[:bundle]).strip %> exec rake solid_queue:start
ExecReload=/bin/kill -TSTP $MAINPID
ExecStop=/bin/kill -TERM $MAINPID
Environment=MALLOC_ARENA_MAX=2
# if we crash, restart
RestartSec=1
Restart=on-failure
<%= "StandardOutput=append:#{fetch(:solid_queue_access_log)}" if fetch(:solid_queue_access_log) %>
<%= "StandardError=append:#{fetch(:solid_queue_error_log)}" if fetch(:solid_queue_error_log) %>
SyslogIdentifier=<%= fetch(:solid_queue_service_unit_name) %>
[Install]
WantedBy=default.target