Fix PID issue

This commit is contained in:
Kload 2013-11-21 09:46:41 +01:00
parent 8ca9f69691
commit 8cd358e358

View file

@ -116,6 +116,7 @@ def http_exec(request, **kwargs):
with open('/var/run/yunohost.pid', 'r'):
raise YunoHostError(1, _("A YunoHost command is already running"))
except IOError:
if dict['function'].split('.')[1] != 'tools_postinstall':
with open('/var/run/yunohost.pid', 'w') as f:
f.write('ldap')
os.system('chmod 400 /var/run/yunohost.pid')
@ -127,8 +128,10 @@ def http_exec(request, **kwargs):
except KeyboardInterrupt, EOFError:
raise YunoHostError(125, _("Interrupted"))
finally:
try:
os.remove('/etc/yunohost/passwd')
os.remove('/var/run/yunohost.pid')
except: pass
if result is None:
result = {}
if len(yunohost.win) > 0: