FIX: Always remove pids on boot
authorSam Saffron <sam.saffron@gmail.com>
Tue, 25 Aug 2020 07:20:51 +0000 (17:20 +1000)
committerSam Saffron <sam.saffron@gmail.com>
Tue, 25 Aug 2020 07:20:51 +0000 (17:20 +1000)
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

templates/web.template.yml

index fc4918023e7acec80c742fc59d5b974c8efb5048..6dd9f69032860f42884460462648f59a637838dd 100644 (file)
@@ -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