0

I am ssh-ing into a Linux cluster that uses an AFS home directory. I am trying to use GNU screen to run a long-running program in a detached screen. If I remain logged in the program executes perfectly, and this includes writing to a file.

I want to be able to logout from the ssh session and leave the program running in the detached screen. I try logging out and ssh-ing back in. However, when I check on the detached screen I see that my program has crashed because it did not have permissions to write to file.

[local]me: ssh info@inf.ed.us
[remote]user: screen    # this pops up a new screen
[remote]user: python get_data.py

I then hit Ctrl-a d (to detach screen)

[remote]user: logout
[local]me: ssh info@inf.ed.us
[local]me: screen

And this is what I see in the detached screen:

 Traceback (most recent call last):
      File "get_data.py", line 430, in <module>
      File "get_data.py", line 346, in produce_roof_patches
      File "get_data.py", line 225, in save_patch
    IOError: [Errno 13] Permission denied: '../data/training/labels.csv'

If I do not log out and simply detach (Ctrl-a d) and reattach via 'screen' then the program continues running without any trouble.

I have read that this is because when logging out my filesystem becomes unmounted and the program does not have permissions to write anywhere in my filesystem. Is there a workaround for this?

unicorn_poet
  • 101
  • 2

2 Answers2

0

Detached... as in... <control>-<z> then bg? or running with the & symbol? These are not detached. These are forked processes.

Detached processes can be started using the nohup command, or run in a tmux session or some such.

If you would like more information about any of these, feel free to ask.

TheCompWiz
  • 7,409
  • 17
  • 23
0

Using absolute paths instead of relative paths to write to file fixed my problem.

unicorn_poet
  • 101
  • 2