FIX: Always remove pids on boot

FIX: Always remove pids on boot

Previously if unicorn stopped abruptly we could have a situation where pids were left around

This could lead to Sidekiq not booting

This will ensure that on boot our state is clean

diff --git a/templates/web.template.yml b/templates/web.template.yml
index fc49180..6dd9f69 100644
--- a/templates/web.template.yml
+++ b/templates/web.template.yml
@@ -288,7 +288,12 @@ run:
         rm -rf /shared/tmp/{backups,restores}
         mkdir -p /shared/tmp/{backups,restores}
         chown -R discourse:www-data /shared/tmp/{backups,restores}
-
+  - file:
+      path: /etc/runit/1.d/01-cleanup-web-pids
+      chmod: +x
+      contents: |
+        #!/bin/bash
+        /bin/rm -f /var/www/discourse/tmp/pids/*.pid
   # change login directory to Discourse home
   - file:
      path: /root/.bash_profile

GitHub sha: ca39457f

1 Like