Commit 4b5f2a7f authored by Vivien Alger's avatar Vivien Alger

davstorage: Changed postfix service to python script

parent 255c0a3b
......@@ -85,7 +85,7 @@ mode = 0644
[instance-davstorage]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-davstorage.cfg
md5sum = 7f3be7bf2b4de1624b990846c5712c44
md5sum = 26ff128c6d5b999596002ef1d97ad8fb
output = ${buildout:directory}/template-davstorage.cfg
mode = 0644
......@@ -120,7 +120,7 @@ url = ${:_profile_base_location_}/templates/${:filename}
filename = postfix.in
download-only = true
mode = 0755
md5sum = 94799688bf95fb16b86972a23df13af2
md5sum = 9f136d6c217f26e06f7437ceeb7b0c42
[sendmail-script-template]
recipe = hexagonit.recipe.download
......
......@@ -231,11 +231,13 @@ md5sum = f681c0a0a17f4b2a0896b952e53239ed
[postfix-service]
recipe = slapos.recipe.template
url = ${postfix-service-template:location}/${postfix-service-template:filename}
python-location = ${python2.7:executable}
postfix-location = ${postfix:location}/usr/sbin/postfix
postfix-config-dir = $${directory:postfix-conf}
pid-location = $${directory:pid}/master.pid
output = $${basedirectory:services}/postfix
mode = 0755
md5sum = 94799688bf95fb16b86972a23df13af2
md5sum = 9f136d6c217f26e06f7437ceeb7b0c42
[sendmail-script]
recipe = slapos.recipe.template
......
#!/bin/sh
${:postfix-location} -c ${:postfix-config-dir} start
\ No newline at end of file
#!${:python-location}
import subprocess
import signal
import time
def handler(signum,frame):
pid_file = open("${:pid-location}","r")
pid = pid_file.read().strip()
subprocess.call(["kill", "-9", pid])
subprocess.call(["${:postfix-location}", "-c", "${:postfix-config-dir}", "start"])
signal.signal(signal.SIGINT,handler)
while True:
time.sleep(120)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment