Control: tag -1 moreinfo

Hi Phil,

Phil Dibowitz wrote:
> After a fresh eboot, trying to create a screen session fails with:
> 
>   [phil@rider ~]$ screen
>   Cannot make directory '/run/screen': Permission denied

Hrm. This issue occassionally popped up as bug report, most often in
Ubuntu (see at the end of the mail), but I never was really able to
reproduce them in Debian.

Note: There a two types of similar bug reports: Those where
[/var]/run/screen couldn't be created and those where
[/var]/run/screen exists but has wrong permissions so that
subdirectories in it couldn't be created.

> It's easy enough to make a 'screen' dir with 777 perms as screen
> expects, but the user shouldn't have to do this manually.

Of course this should not happen at all. So thanks for that bug
report.

On the Debian side, I thought that I finally fixed both types of these
issues by switching from the opt-out setgid (which required
permissions fiddling in postinst) to libutempter and hence not
requiring any setgid/setuid anymore: https://bugs.debian.org/471763
(type: wrong permissions of /var/run/screen, but the fix should fix
both types of issues)

Nevertheless special /run/screen permissions are still supported by
postinst (probably not directly relevant in this case since it's about
a reboot) and either systemd or the screen-cleanup init script since
administrators could still use dpkg-statoverride.

In your case it's systemd who should handle the creation of that directory
at boot time via the /etc/tmpfiles.d/screen-cleanup.conf file:

> Init: systemd (via /run/systemd/system)

So it would be nice if you could provide the following additional
information:

* Are "/run" and "/var/run" the same directory? (They should be,
  otherwise _that_ is the bug.)

* What are the permissions of the directory "/run"?

* What are the permissions of /usr/bin/screen? (i.e. are there any
  stat-overrides for screen?)

* Does /etc/tmpfiles.d/screen-cleanup.conf exist?

* If so, please tell me its contents.

* Does /lib/systemd/system/screen-cleanup.service exist and is it a
  symbolic link to /dev/null? (Just to make sure systemd does not run
  the according init script, see
  https://bugs.launchpad.net/ubuntu/+source/screen/+bug/1462692)

All these questions can be easily answered with sending the output of
these two commands to this bug report:

  ls -ldU /run /var/run /usr/bin/screen /etc/tmpfiles.d/screen-cleanup.conf 
/lib/systemd/system/screen-cleanup.service /etc/init.d/screen-cleanup 
/etc/rc?.d/*screen-cleanup
  cat /etc/tmpfiles.d/screen-cleanup.conf

There's only one question left which can't be scripted that easily:

* How quickly after the reboot did this happen? Given the prompt, I
  assume it wasn't started from a cron-job with "@reboot" or such.

For the sake of completeness, here's a list of (seemingly) related Ubuntu
bug reports:

Some of those bug reports in Ubuntu were solely happening with Upstart
(which is gone now for several Ubuntu releases), like
https://bugs.launchpad.net/ubuntu/+source/screen/+bug/595898 (type:
mkdir /var/run/screen fails)

Some others are said to be fixed or only happpend during the ubuntu-specific
do-release-upgrade which uses screen itself:

* https://bugs.launchpad.net/ubuntu/+source/screen/+bug/574773 (type:
  mkdir /var/run/screen fails; fixed by
  
http://launchpadlibrarian.net/53865604/screen_4.0.3-14ubuntu1.1_4.0.3-14ubuntu1.2.diff.gz)
* https://bugs.launchpad.net/ubuntu/+source/screen/+bug/1761997 (type:
  wrong permissions of /var/run/screen; issue during
  do-release-upgrade on Ubuntu only, but has some details about how
  the permissions of that file work(ed).)
* https://bugs.launchpad.net/ubuntu/+source/screen/+bug/29908 (type:
  wrong permissions of /var/run/screen; closed due to missing feedback
  from the reporter after three months. An ancient bug report from
  2006, too.)

So I assume that this issue is not related to any of these issues,
despite looking very similar.

                Regards, Axel
-- 
 ,''`.  |  Axel Beckert <a...@debian.org>, https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE

Reply via email to