Can't run screen in Gutsy

Bug #172651 reported by Martin
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
screen (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Binary package hint: screen

$ screen
Cannot make directory '/var/run/screen': Permission denied
$

Revision history for this message
yvon vignaud (yvonalaplage) wrote :

Thank you for reporting this bug. Could you please give some details ? Knowing the release of Ubuntu and the version of 'screen' you are using may be very helpful. Also, can you run 'sudo screen' without problems ?

Changed in screen:
status: New → Incomplete
Revision history for this message
Siegfried Gevatter (rainct) wrote :

Thanks for your bug report!

Can you please try if «sudo screen» works? And if this works, does it work afterwards without the sudo, too?

Revision history for this message
Martin (martin615) wrote :

I'm running a fully updated Gutsy install.

Fixed by mkdir /var/run/screen dir by hand, chmod 775 and chgrp to utmp.

Don't see any point in doing "sudo screen" at this point. :) (I fixed it, see above, before filing the bug.) I also have screen instanses running right now so I can't remove the dir and test either.

It's quite obvious what the problem is though, /var/run/screen wasn't created at install time... right?

Revision history for this message
Martin (martin615) wrote :

I'm running a fully updated Gutsy install.

Did mkdir /var/run/screen dir, chmod 775 and chgrp to utmp. Don't see any point in doing "sudo screen" after that. :) (Fixed it before filing the bug.) I also have screen instances running right now so deleting the dir right now isn't an option.

It's quite obvious what the problem is though, /var/run/screen wasn't created at install time... right?

Revision history for this message
Martin (martin615) wrote :

Bah! Ignore the first post of those two. (Stupid browser!)

Revision history for this message
Martin (martin615) wrote :

Oh, and also, try to cope with by badly fast written english in the last post. It's better than in the first but... (I hate that you can't go back and edit comments!!! :)

Spam spam spam, wonderful spam, lovely spam, spam spam spam... :p

Revision history for this message
yvon vignaud (yvonalaplage) wrote :

Martin: 'It's quite obvious what the problem is though, /var/run/screen wasn't created at install time... right?'

Not so obvious to me. The error message shows that screen tries to create this directory, but simply can't. Looks very similar to bug #13143, which was supposed to be solved in Hoary.

Is your /var/run mounted as a tmpfs ?

Revision history for this message
Martin (martin615) wrote :

> Not so obvious to me.

Well, it's obvious that /var/run/screen can't be created when screen is run (as !root) so it must be created before that. At boot? At install time? Don't know. But yes, if it is supposed to be created by some init script, and isn't, perhaps finding the bug in that script ain't so obvious...

> Is your /var/run mounted as a tmpfs ?

$ df -h /var/run
Filesystem Size Used Avail Use% Mounted on
varrun 252M 96K 252M 1% /var/run

Haven't setup /var/run to be anything else than what the default install gave me. (In other words, it should just work (tm) :)

Revision history for this message
Daniel Hahler (blueyed) wrote :

This appears to be fixed since Hardy (screen 4.0.3-1):
    * Recreate /var/run/screen on install/reboot if necessary (e.g. tmpfs) with
      the appriopriate permissions (depending on the screen binary - some
      admins might choose to install it setuid using dpkg-statoverride).
      Closes: #357578, #390506, #397088.

I've run into this, because the init script link to /etc/init.d/screen-cleanup was missing on my system (accidently removed). I've solved this by reinstall screen:
sudo apt-get install --reinstall screen

The workaround seems to be manually extending the existing startup script, e.g. for Dapper or Gutsy with the snippet from Hardy for this:
case "$1" in
start)
    if test -L $SCREENDIR || ! test -d $SCREENDIR; then
        rm -f $SCREENDIR
        mkdir $SCREENDIR
        chown root:utmp $SCREENDIR
    fi
    find $SCREENDIR -type p -print0 | xargs -0r rm -f --
# If the local admin has used dpkg-statoverride to install screen setuid,
# change the permissions of $SCREENDIR accordingly
    if [ `stat -c%a /usr/bin/screen` -ge 4000 ]; then
        chmod 0755 $SCREENDIR
    else
        chmod 0775 $SCREENDIR
    fi
    ;;

Changed in screen:
importance: Undecided → Medium
status: Incomplete → Fix Released
Revision history for this message
Andrew Conkling (andrewski) wrote :

For what it's worth: I just ran into this error after upgrading to Jaunty Alpha 2; running `sudo /etc/init.d/screen-cleanup start` manually fixed the problem for me.

Revision history for this message
Betty (sturdyandserviceable) wrote :

FWIW, I just ran into this error after my computer crashed while running an instance of screen. Fixed as discussed in this post.

Revision history for this message
Kete (handheld-car) wrote :

Reinstalling screen also worked for the new Lucid after upgrading.

Revision history for this message
Kete (handheld-car) wrote :

Actually, even though I restarted yesterday to test the functionality of screen, I had this same problem this morning and went with the second solution. (sudo /etc/init.d/screen-cleanup start)

Revision history for this message
Kete (handheld-car) wrote :

Um, neither one of these is a permanent fix. Once again, I have to do one or the other.

Revision history for this message
vedavata (vedavrata) wrote :

i got the same problem on lucid (10.4)... :-(

'sudo /etc/init.d/screen-cleanup start' helped. thank you.

Revision history for this message
mathew (meta23) wrote :

Yeah, bug is back in Lucid. I just encountered it on a clean install.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Please provide the output of:
$ ls -l /etc/rc*/*screen-cleanup*

There should be a link present (via /etc/rcS.d/S70screen-cleanup in my case).

In case it is, something breaks this later again on startup.

What is the error when you want to start screen? The "Cannot make directory '/var/run/screen': Permission denied" one?

Changed in screen (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
oren (orengolan) wrote :

(on Lucic)

screen
Cannot make directory '/var/run/screen': Permission denied

ls -l /etc/rc*/*screen-cleanup*
lrwxrwxrwx 1 root root 24 2009-07-21 03:50 /etc/rcS.d/S70screen-cleanup -> ../init.d/screen-cleanup

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 172651] Re: Can't run screen in Gutsy

The last commenter is seeing Bug #574773.

Revision history for this message
Axel Beckert (xtaran) wrote :

Looks similar to the also exhaustly discussed http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=471763

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.