Applications on macbook pro close waking computer up after 1 hour lunch
Not sure what's going on with your settings, but I think you will find that caffeinate can prevent this behavior. At a terminal screen, type man caffeinate to learn about the utility. An option that may work for you is this: 


  caffeinate -s 


Alternatively, if you have an application you wish to run while you are away from your Mac, you can use this form: 


  caffeinate -w PID &amp; 


where PID is the process ID of the app that's running (available via Activity Monitor, or ps -la), and &amp; for running in background.