I have an Ubuntu 12.04 server which runs a python application. The application is started manually in
tmux or automatically when the server starts.
Application processes http requests from android clients. It saves some data to hard drive:
os.mkdir(directory_path) with open(file_name, "w") as f: f.write(text)
Application sent exceptions to telegram chat:
OSError: [Errno 13] Permission denied: '/home/username/Desktop'
With an active ssh connection, everything works fine. After closing the client ssh terminal, I get a lot of "Permission denied" errors in the server's log about attempting to create a file or directory. After connecting with ssh (only connecting, without running any commands) everything works fine again and new files or folders are created by the application.
-- Does this happen when the program is started by the server and not in a tmux session? Yes. The problem appears in both cases.
-- Does connecting to the machine automatically reattach the tmux session? No. Attaching to tmux is manual(tmux a). Application works fine after ssh connection to server. Attaching tmux is not necessary.
How can the ssh connection affect a running application process or system access rights?