Fix the Systemd unit for discourse
Switch the systemd unit to a oneshot type
This commit is contained in:
parent
dc2fe38e10
commit
255e43c680
@ -35,19 +35,24 @@ git deploy_path do
|
|||||||
revision "master"
|
revision "master"
|
||||||
end
|
end
|
||||||
|
|
||||||
# FIXME: The systemd unit does not work
|
systemd_unit "discourse.service" do
|
||||||
template "/etc/systemd/system/discourse.service" do
|
content({Unit: {
|
||||||
source "discourse.service.erb"
|
Description: "discourse service with docker compose",
|
||||||
variables deploy_path: deploy_path
|
Requires: "docker.service",
|
||||||
notifies :run, "execute[systemctl daemon-reload]", :immediately
|
After: "docker.service",
|
||||||
end
|
},
|
||||||
|
Service: {
|
||||||
execute "systemctl daemon-reload" do
|
Type: "oneshot",
|
||||||
action :nothing
|
RemainAfterExit: "true",
|
||||||
end
|
WorkingDirectory: deploy_path,
|
||||||
|
Environment: "SUPERVISED=true",
|
||||||
service "discourse" do
|
ExecStart: "#{deploy_path}/launcher start app",
|
||||||
action [:enable]
|
ExecStop: "#{deploy_path}/launcher stop app",
|
||||||
|
},
|
||||||
|
Install: {
|
||||||
|
WantedBy: "multi-user.target"
|
||||||
|
}})
|
||||||
|
action [:create, :enable]
|
||||||
end
|
end
|
||||||
|
|
||||||
template "#{node['nginx']['dir']}/sites-available/#{domain}" do
|
template "#{node['nginx']['dir']}/sites-available/#{domain}" do
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=discourse service with docker compose
|
|
||||||
Requires=docker.service
|
|
||||||
After=docker.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
WorkingDirectory=<%= @deploy_path %>
|
|
||||||
|
|
||||||
Environment="SUPERVISED=true"
|
|
||||||
|
|
||||||
ExecStartPre=<%= @deploy_path %>/launcher stop app
|
|
||||||
# Remove all containers that have stopped for > 24 hours
|
|
||||||
ExecStartPre=<%= @deploy_path %>/launcher cleanup
|
|
||||||
|
|
||||||
ExecStart=<%= @deploy_path %>/launcher start app
|
|
||||||
|
|
||||||
ExecStop=<%= @deploy_path %>/launcher stop app
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user