I have a machine running Ubuntu server version 12.04.3 LTS. On it, I'm attempting to run a node.js server that needs to stay up and running at all times. I'm running into an issue, however, where periodically I see this happen:
+ Stopped sudo node server.js
When this happens, I have to manually bring it back with
fg, which works fine, at least until it stops again. As far as I can tell, it isn't functioning properly while stopped, since I get no log files in those windows of time. So my question is this: Is there a way to prevent it from being stopped like that? I'm running it in a tmux window, if that changes anything.
Also, to address the question before it gets asked: I'm running it as sudo due to some ecryptfs issues I've been having. I was originally running it in my home directory, but when it was left alive for too long things would get out of sync and the file writes it has to do would just stop working. To mitigate that, I moved it out of my home directory, but its new location requires me to use sudo permissions for everything to work correctly. Hopefully that isn't related to the whole background task thing.
(sudo and tmux tags included in case one or both turn out to actually be relevant to the solution.)
Update: At the advice of a friend, I stopped running it as sudo and instead
chown'd the entire folder so that I could let it run without elevated permissions. I have yet to determine if the stopping is still happening (just barely restarted it), but with any luck that will resolve my problem. The question still stands, though, if for no other reason than curiosity.