# HG changeset patch
# User Goffi <goffi@goffi.org>
# Date 1455812390 -3600
# Node ID 8dd32aa496140956241c5c2bcf03e40cf5f2be56
# Parent  5824dee4ea2b2a0bc95a9c27025a2b095ec54947
docker: pid files are put in /tmp to avoid conflict when restarting a container

diff -r 5824dee4ea2b -r 8dd32aa49614 docker/base/Dockerfile
--- a/docker/base/Dockerfile	Thu Feb 18 14:43:33 2016 +0100
+++ b/docker/base/Dockerfile	Thu Feb 18 17:19:50 2016 +0100
@@ -70,6 +70,9 @@
 
 # Following scripts make the configuration as automatic and easy as possible
 
+# we want .pid files in /tmp so they are removed if container are deleted
+RUN echo '[DEFAULT]\npid_dir=/tmp' >> /etc/sat.conf
+
 # we auto-create libervia account if it doesn't exists in Libervia container
 # so we remove it from reserved_list in plugin account
 RUN echo '[plugin account]\nreserved_list=' >> /etc/sat.conf
diff -r 5824dee4ea2b -r 8dd32aa49614 docker/salut/Dockerfile
--- a/docker/salut/Dockerfile	Thu Feb 18 14:43:33 2016 +0100
+++ b/docker/salut/Dockerfile	Thu Feb 18 17:19:50 2016 +0100
@@ -26,7 +26,7 @@
 for var in ("DOMAIN", "SAT_SALUT_SECRET"):\n\
     os.environ[var] = proxy.getenv(var)\n\
 os.environ["PYTHONPATH"] = SALUT_PATH\n\
-os.execlp("twistd", "twistd", "-ny", SALUT_PATH+"salut.tac")\n\
+os.execlp("twistd", "twistd", "-ny", SALUT_PATH+"salut.tac", "--pidfile", "/tmp/salut.pid")\n\
 ' > /usr/local/bin/salut && chmod 0555 /usr/local/bin/salut
 
 WORKDIR /usr/share
diff -r 5824dee4ea2b -r 8dd32aa49614 docker/sat_pubsub/Dockerfile
--- a/docker/sat_pubsub/Dockerfile	Thu Feb 18 14:43:33 2016 +0100
+++ b/docker/sat_pubsub/Dockerfile	Thu Feb 18 17:19:50 2016 +0100
@@ -26,7 +26,7 @@
 proxy = xmlrpclib.ServerProxy("http://prosody:9999/")\n\
 domain = proxy.getenv("DOMAIN")\n\
 secret = proxy.getenv("SAT_PUBSUB_SECRET")\n\
-os.execlp("twistd", "twistd", "-n", "sat_pubsub", "--rhost", "prosody",\
+os.execlp("twistd", "twistd", "-n", "--pidfile", "/tmp/sat_pubsub.pid", "sat_pubsub", "--rhost", "prosody",\
  "--jid", "pubsub.%s" % domain, "--secret", secret)\n\
 ' > /usr/local/bin/sat_pubsub && chmod 0555 /usr/local/bin/sat_pubsub