Commit 07e87e75 authored by Vivien Alger's avatar Vivien Alger

Changed postfix service to python script

parent 2aab2906
...@@ -120,7 +120,7 @@ url = ${:_profile_base_location_}/templates/${:filename} ...@@ -120,7 +120,7 @@ url = ${:_profile_base_location_}/templates/${:filename}
filename = postfix.in filename = postfix.in
download-only = true download-only = true
mode = 0755 mode = 0755
md5sum = 94799688bf95fb16b86972a23df13af2 md5sum = 29b98e2f3ac937c1e4e73c43a562a2d0
[sendmail-script-template] [sendmail-script-template]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
......
...@@ -231,8 +231,10 @@ md5sum = f681c0a0a17f4b2a0896b952e53239ed ...@@ -231,8 +231,10 @@ md5sum = f681c0a0a17f4b2a0896b952e53239ed
[postfix-service] [postfix-service]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${postfix-service-template:location}/${postfix-service-template:filename} url = ${postfix-service-template:location}/${postfix-service-template:filename}
python-location = ${python2.7:executable}
postfix-location = ${postfix:location}/usr/sbin/postfix postfix-location = ${postfix:location}/usr/sbin/postfix
postfix-config-dir = $${directory:postfix-conf} postfix-config-dir = $${directory:postfix-conf}
pid-location = $${directory:pid}/master.pid
output = $${basedirectory:services}/postfix output = $${basedirectory:services}/postfix
mode = 0755 mode = 0755
md5sum = 94799688bf95fb16b86972a23df13af2 md5sum = 94799688bf95fb16b86972a23df13af2
......
#!/bin/sh #!${:python-location}
${:postfix-location} -c ${:postfix-config-dir} start import subprocess
\ No newline at end of file import signal
import time
def handler(signum,frame):
subprocess.call("kill -9 `cat ${:pid-location}`")
subprocess.call("${:postfix-location} -c ${:postfix-config-dir} start")
signal.signal(-1,handler)
while True:
time.sleep(120)
\ No newline at end of file
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