Hi Kwankyu, Thanks for your work. Here are some comments for the current version:
49 os.kill(pid,signal.SIGTERM) 50 time.sleep(.5) 51 if os.path.isfile(pid_file): 52 print "Waiting for the sage server to terminate..." 53 time.sleep(3) 54 if os.path.isfile(pid_file): # assume the server process is malbehaving. 55 print "Killing the errorneous sage server process..." 56 os.kill(pid,signal.SIGKILL) 57 os.remove(pid_file) Line 50 "blocks" (waits syncronously without checking status); also half of a second may not be long enough if all memory was used up and there was excessive paging in/out from the swap file. One alternative method is to check for the existence of the pid file periodically for a longer period (possibly parameterized), and if it is deleted, recheck that the twistd process has indeed exited else send SIGKILL. Otherwise, good refactor. :-) -Don On Oct 14, 10:36 pm, Kwankyu Lee <ekwan...@gmail.com> wrote: > Hi Don, > > I just uploaded a revised version of the script modified according to > your comments. Check it out! > > Kwankyu -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org