mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Fix PID issue
This commit is contained in:
parent
8ca9f69691
commit
8cd358e358
1 changed files with 8 additions and 5 deletions
|
@ -116,6 +116,7 @@ def http_exec(request, **kwargs):
|
||||||
with open('/var/run/yunohost.pid', 'r'):
|
with open('/var/run/yunohost.pid', 'r'):
|
||||||
raise YunoHostError(1, _("A YunoHost command is already running"))
|
raise YunoHostError(1, _("A YunoHost command is already running"))
|
||||||
except IOError:
|
except IOError:
|
||||||
|
if dict['function'].split('.')[1] != 'tools_postinstall':
|
||||||
with open('/var/run/yunohost.pid', 'w') as f:
|
with open('/var/run/yunohost.pid', 'w') as f:
|
||||||
f.write('ldap')
|
f.write('ldap')
|
||||||
os.system('chmod 400 /var/run/yunohost.pid')
|
os.system('chmod 400 /var/run/yunohost.pid')
|
||||||
|
@ -127,8 +128,10 @@ def http_exec(request, **kwargs):
|
||||||
except KeyboardInterrupt, EOFError:
|
except KeyboardInterrupt, EOFError:
|
||||||
raise YunoHostError(125, _("Interrupted"))
|
raise YunoHostError(125, _("Interrupted"))
|
||||||
finally:
|
finally:
|
||||||
|
try:
|
||||||
os.remove('/etc/yunohost/passwd')
|
os.remove('/etc/yunohost/passwd')
|
||||||
os.remove('/var/run/yunohost.pid')
|
os.remove('/var/run/yunohost.pid')
|
||||||
|
except: pass
|
||||||
if result is None:
|
if result is None:
|
||||||
result = {}
|
result = {}
|
||||||
if len(yunohost.win) > 0:
|
if len(yunohost.win) > 0:
|
||||||
|
|
Loading…
Reference in a new issue