I'm being constantly frustrated with this issue, and I'm still not sure the best way to solve it.
I have my ubuntu server running headless with cgminer, and it is configured to automatically take security updates.
WHY is it configured to automatically take updates? You aren't running windows.
I think you have identified the source of your frustrations.
Turn off automatic updated. If it ain't broken, don't break it.