Context: I'm using bash in Mac OSX Yosemite.
Problem: I'm executing a (python) script that I expect to use alot of resources and take a few hours to run, redirecting stdout and stderr to a log file.
python script.py >> logfile.txt 2>&1
Upon return, I find that I have been automatically logged out and the job doesn't finish. Furthermore, there is no evidence of a bug in the log file. It seems that the user process is being killed, and I'm curious how to catch it and then to prevent it from happening.
Further relevant detail is that the python script is executing many database operations on a fairly large mongodb instance (~4million rows).
I suspect that this has something to do with the
ulimit settings. Mine are as follows:
$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 256 pipe size (512 bytes, -p) 1 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 709 virtual memory (kbytes, -v) unlimited