Screen must be started with sudo on first use

Bug #312259 reported by Chafnan
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
screen (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When first using screen after every reboot I am getting the following message:

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

When I start in with "sudo screen" the problem is fixed for all users until the computer is rebooted.

Anyone know how to fix this?

-----------------------------------------
$ lsb_release -rd
Description: Ubuntu 8.10
Release: 8.10

$ apt-cache policy screen
screen:
  Installed: 4.0.3-11
  Candidate: 4.0.3-11
  Version table:
 *** 4.0.3-11 0
        500 http://apt-cacher-intrepid intrepid/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Connor Imes (ckimes) wrote :

Before running screen with sudo (so after a fresh reboot, when the error occurs), can you please post the output of
   ls -l /var | grep run
and
   ls -l /usr/bin/screen

The first command should show the permissions of the folder /var/run as 755 (drwxr-xr-x) and owned by root:root
The last command should show screen to have permissions 755 with sgid (rwxr-sr-x) and owned by root:utmp

If the last command doesn't show something very similar to
   -rwxr-sr-x 1 root utmp 308228 2007-10-23 12:02 /usr/bin/screen
Then run
   sudo chown root:utmp /usr/bin/screen
   sudo chmod 755 /usr/bin/screen
   sudo chmod g+s /usr/bin/screen

Since this bug didn't have a package associated with it, I am filing it under "screen", though I expect this is a configuration problem and not a bug. Thanks in advance for the information requested. Let me know if the problem is solved.

Revision history for this message
Chafnan (chafnan) wrote : Re: [Bug 312259] Re: Screen must be started with sudo on first use

Here are the results right after startup:

$ ls -l /var | grep run
drwxr-xr-x 17 root root 780 2008-12-31 11:29 run

$ ls -l /usr/bin/screen
-rwxr-sr-x 1 root utmp 364K 2008-06-13 12:24 /usr/bin/screen

Still produces error

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

Any other ideas? Do I need to be a member of the utmp group or what is that
group and 's' setting?

Revision history for this message
Connor Imes (ckimes) wrote :

Are you mounting /var or /var/run separately from the rest of your filesystem? The permissions look correct on the files and folders (the "s" is setgid). I would suggest trying to reinstall screen, and also upload to this bug report as separate attachments the file
   /etc/fstab
the output of the mount command in a text file:
   mount > mount.txt
the groups command:
   groups > groups.txt
and information about your kernel:
   uname -a > uname-a.txt

Thanks in advance.

Revision history for this message
Chafnan (chafnan) wrote :

It looks like I am mounting /var/run separately. I also tried to reinstall
screen, but it didn't change anything.

Here are the files that you requested.

Thanks for helping me with this.

Revision history for this message
Connor Imes (ckimes) wrote :

It's possible that during reinstall some conf files didn't get removed, so let's try to purge screen then install it again (PLEASE don't purge from apt-get as ubuntu-desktop depends on screen).
   sudo dpkg --force-depends --purge screen
   sudo apt-get install screen

Does the problem still persist?

Revision history for this message
Chafnan (chafnan) wrote :

This last suggestion has fixed the issue. Thanks for the help!

Revision history for this message
Connor Imes (ckimes) wrote :

Thanks for following up, I'm glad it's working. I'll close this bug report now.

Changed in screen:
status: Incomplete → Invalid
Revision history for this message
Mike.lifeguard (mikelifeguard) wrote :

This still occurs. I reinstalled screen, and now get the same error recurring about 2 weeks later. As reported, using sudo screen first lets other users use screen until reboot.

Changed in screen (Ubuntu):
status: Invalid → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in screen (Ubuntu):
status: New → Confirmed
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.