changeset 83:8dd32aa49614

docker: pid files are put in /tmp to avoid conflict when restarting a container
author Goffi <goffi@goffi.org>
date Thu, 18 Feb 2016 17:19:50 +0100
parents 5824dee4ea2b
children 8dc445c967e2
files docker/base/Dockerfile docker/salut/Dockerfile docker/sat_pubsub/Dockerfile
diffstat 3 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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
--- 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