git://git.onelab.eu
/
mom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
56bcba1
)
waitpid for forked processes. Was zombie'ing before.
author
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Wed, 19 Jul 2006 18:55:06 +0000
(18:55 +0000)
committer
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Wed, 19 Jul 2006 18:55:06 +0000
(18:55 +0000)
swapmon.py
patch
|
blob
|
history
diff --git
a/swapmon.py
b/swapmon.py
index
83b4ec1
..
8425b4d
100755
(executable)
--- a/
swapmon.py
+++ b/
swapmon.py
@@
-194,14
+194,17
@@
class Reset:
print kill_subject % params
print kill_body % params
try:
print kill_subject % params
print kill_body % params
try:
-
self.
pid = os.fork()
- if
self.
pid == 0:
+ pid = os.fork()
+ if pid == 0:
print "Slice %s is being killed." % self.name
vserver = VServer(self.name)
vserver.stop()
os._exit(0)
print "Slice %s is being killed." % self.name
vserver = VServer(self.name)
vserver.stop()
os._exit(0)
+ else:
+ os.waitpid(pid,0)
except Exception, err:
except Exception, err:
- print "Warning: Exception received while killing slice %s: %s" % self.name, err
+ print "Warning: Exception received while killing slice %s: %s" \
+ % self.name, err
if (time.time() - self.killmail) > email_timeout:
slicemail(self.name, kill_subject % params, kill_body % params)
print "Sending KILL email for slice %s" % self.name
if (time.time() - self.killmail) > email_timeout:
slicemail(self.name, kill_subject % params, kill_body % params)
print "Sending KILL email for slice %s" % self.name
@@
-235,6
+238,8
@@
class Reset:
vserver.stop()
vserver.start(wait = False)
os._exit(0)
vserver.stop()
vserver.start(wait = False)
os._exit(0)
+ else:
+ os.waitpid(pid,0)
except Exception, err:
print "Warning: Exception received while resetting slice %s:" \
% self.name, err
except Exception, err:
print "Warning: Exception received while resetting slice %s:" \
% self.name, err