1

On Google Cloud Compute Engine GNU screen is exiting with no message. It works if I "sudo screen" but that is not what I need. The binary is suid root and has correct permissions, and I have also tried compiling my own copy of the latest screen straight from FSF. I have tried the copy of screen shipped with both Ubuntu and Debian images.

I have not been able to find any information on why this would happen (with no message) so I am assuming it is something Google Cloud related more than screen related? Screen is supposed to work on Google Cloud - they recommend using it. Not sure what's up, any help appreciated.

lrwxrwxrwx 1 root root 12 Jul 10 08:46 /usr/bin/screen -> screen-4.6.2
-rwsr-xr-x 1 root root 1613208 Jul 10 08:46 /usr/bin/screen-4.6.2

I tested it and tmux works so that is one way to achieve it but I am more accustomed to screen's key bindings.

Jason
  • 395
  • 1
  • 5
keith
  • 11
  • 2

1 Answers1

0

It might be that screen cannot write to the socket directory for your user – by default, /var/run/screen/S-$USER. This seems especially likely to me as you say that it works for your root user.

(Yes, normally you ought to be shown an error message to that effect, but I think there's always a chance something is simply hiding that.)

Thus I recommend looking at the permissions of /var/run/screen (what I see on working systems is root:utmp 01775) and the S-* directories in it (perms should be 01700).

You could also try setting the SCREENDIR environment variable to something in your home directory as per this article.

  • /var/run/screen looks like it is 1777 and setting the SCREENDIR did not help, still exits with no message. – keith Jul 18 '18 at 16:40
  • Okay, it turns out the permissions have be just right with relation to the binary, see [here](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520317). Try and run `sudo /etc/init.d/screen-cleanup start` – Sebastian Schleussner Jul 19 '18 at 18:10
  • Still nothing. Since there is no error message I am not hopeful anything like this would help. `make install` should've set the permissions anyway, right? – keith Jul 22 '18 at 00:35
  • A pity. It was admittedly a stab in the dark, because I've been bitten too often by seemingly implausible causes not to check for them. Yes, `make install` ought to take care of all such things, but running explicit commands makes sure nothing has gone wrong during or after that step. It IS weird that screen (if I understand you correctly) does not output anything at all. The closest I can come to your observation is by writing a file `~/testrc` containing `screen 0 true` and running `SYSSCREENRC=- screen -c ~/testrc`, which gives me the immediate output `[screen is terminating]`. – Sebastian Schleussner Jul 22 '18 at 12:18
  • Following up on that idea – have you checked if your `~/.screenrc` contains anything that may have screen quit directly? (`/etc/screenrc` is obviously okay, otherwise root would be affected, too.) – Sebastian Schleussner Jul 22 '18 at 12:21
  • Does `screen -list` yield any output? – Sebastian Schleussner Jul 22 '18 at 12:26
  • BTW, when I test with SCREENDIR pointing to a newly created dir, my screen first aborts with an error saying that the dir's permissions must be 0700. You didn't see that message either, did you? – Sebastian Schleussner Jul 22 '18 at 12:34
  • For reference, here is how that approach does work for me without further steps: `mkdir -m0700 ~/.screen; SCREENDIR=~/.screen screen` – Sebastian Schleussner Jul 22 '18 at 12:35
  • No message of any kind, just immediately exits to command line. This happens with fresh images of both operating systems so it's nothing unique to me. It happens with different terminal emulators. – keith Jul 24 '18 at 05:38
  • I just spun up a basic Google Cloud instance with Ubuntu 18.04 and tried to run screen (in the browser terminal) – no problem whatsoever. (I had not been able to check on GC itself before.) Thus my best guess is still that there is something strange with your configuration; I'm out of particular ideas for now. Maybe someone else will pop in with a fresh take. Good luck! – Sebastian Schleussner Jul 26 '18 at 14:39
  • Ok, thanks. Interesting. I'm done messing with it, tmux works. – keith Jul 26 '18 at 20:24