daemon: Use /dev/null for stdin when running state hooks.
This commit is contained in:
parent
23f7995eab
commit
6dbec302e3
1 changed files with 2 additions and 2 deletions
|
@ -301,8 +301,8 @@ class Session(object):
|
||||||
stdout = None
|
stdout = None
|
||||||
stderr = None
|
stderr = None
|
||||||
try:
|
try:
|
||||||
check_call(["/bin/sh", filename], stdout=stdout,
|
check_call(["/bin/sh", filename], stdin=open(os.devnull, 'r'),
|
||||||
stderr=stderr, close_fds=True,
|
stdout=stdout, stderr=stderr, close_fds=True,
|
||||||
cwd=self.sessiondir, env=self.getenviron())
|
cwd=self.sessiondir, env=self.getenviron())
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.warn("Error running hook '%s' for state %s: %s" %
|
self.warn("Error running hook '%s' for state %s: %s" %
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue