Hello!

On Sun, 05 Nov 2006 05:28:26 +0100, Adam Lazur wrote:
> Tino Keitel ([EMAIL PROTECTED]) said:
>> the initscript /etc/init.d/screen is only intended to remove files
>> from /var/run during bootup. However, /var/run is already cleaned
>> up by /etc/init.d/bootclean. The latter is part of the initscripts
>> package, which has priority "required". I think the screen
>> initscript is useless bloat that can be removed.
>
> Nice, I like fancy new generic initscripts that make the hackish one
> go away. I'll remove the initscript in the next uploaded version.

Please don't and instead modify the initscript to check for the
existence of /var/run/screen, thus solving bug #390506 [1], which I
just experienced as I started to have /var/run as tmpfs [2].

Digging into the screen bugs, I found bug #214796 [3], which asks for
not using /var/run for FIFOs (behavior started with version 3.9.5-5 to
solve bug #51088 [4]).  Even if I'm not an expert, I think that
/var/run/screen should be kept as the default socket directory, as
this is clearly stated in the screen manual page:
=====
CUSTOMIZATION
       The "socket directory" defaults either to $HOME/.screen or
       simply to /tmp/screens or preferably to /var/run/screen chosen
       at compile-time.  If screen is installed setuid-root, then the
       administrator should com‐ pile screen with an adequate (not NFS
       mounted) socket directory.  If screen is not running
       setuid-root, the user can specify any mode 700 directory in the
       environment variable $SCREENDIR.

FILES
       [...]
       /var/run/screen/S-<login>         Socket directories (default)
=====

In any case (keeping /var/run/screen or moving to /tmp/screen), the
init script should check for the existence of the socket dir.

Thus, IMHO the script should be renamed to 'screen' (as we don't need
to clean anything as already pointed out by the bug submitter) and the
following patch should be applied [5]:
=====
--- /etc/init.d/screen-cleanup  2004-11-14 19:26:30.000000000 +0100
+++ /home/luca/screen   2006-11-12 17:32:21.000000000 +0100
@@ -1,7 +1,7 @@
 #!/bin/sh
 # $Id: init,v 1.3 2004/03/16 01:43:45 zal Exp $
 #
-# Script to remove stale screen named pipes on bootup.
+# Script to check the existence of /var/run/screen on bootup.
 #
 set -e
 
@@ -9,9 +9,9 @@
 
 case "$1" in
 start)
-    if find $SCREENDIR -type p | grep '^' >/dev/null; then
-        echo -n 'Cleaning up stale screen sessions... '
-        find $SCREENDIR -type p -print0 | xargs -0 rm -f
+    if [ ! -d $SCREENDIR ]; then
+        echo -n "Creating $SCREENDIR..."
+        mkdir -m 0777 $SCREENDIR
         echo "done."
     fi
     ;;
=====

Thx, bye,
Gismo / Luca

Footnotes: 
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=390506
[2] http://lists.debian.org/debian-devel/2006/10/msg01277.html
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=214796
[4] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=51088
[5] I didn't tag the bug with 'patch' because doing this with the
    current title is IMHO useless

Attachment: pgpD7tlCnKy3J.pgp
Description: PGP signature

Reply via email to