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 [email protected]
[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 [email protected]
[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?

6
  • Please add the scripts and error messages
    – 030
    Jul 1, 2015 at 20:26
  • What kind of authentication do you have in place? Are your home directories encrypted, auto-mounted via nfs or something else?
    – Zoredache
    Jul 1, 2015 at 21:28
  • I have a feeling that you are using ecryptfs. Can you confirm that please? Do you see a /home/.ecryptfs directory on the system?
    – vagarwal
    Jul 2, 2015 at 12:50
  • I adde more info. I do not have a /home/.ecryptfs directory Jul 3, 2015 at 8:02
  • Also, @Zoredache - how can I find that out? This link has more info on the server, but I couldn't find the info you asked for. Jul 3, 2015 at 8:09

2 Answers 2

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.

2
  • gnu-screen is exactly what tmux resembles. Detaching means not the logout but disconnecting from the launched sessions.
    – Kondybas
    Jul 2, 2015 at 7:04
  • I added more info to my question. Hope that clarifies things! Jul 3, 2015 at 8:02
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .