[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#3276: screen upgrade trashes running sessions...



To correct the problem with screen's postinst always removing /tmp/screens,
thereby cripling currently running processes, I would like to
add the following to the postinst. Could you please check that
this is what we want (I don't want to mess it up real bad just
before the final 1.1 release).

Thanks



[from screen's postinst, 3.7.1-5 (suggested)]:

#this is to remove the "/tmp/screens has incorrect permissions" 
#error message from screen 3.7.1 after upgrading to this (3.7.1)
#version of screen from 3.6 or earlier.


if test  "`ls -ald /tmp/screens|cut -d" " -f 1`" = "drwxr-xr-x"; then
 echo you seem to be upgrading from a post 3.6 version of screen.
 echo "If I'm wrong, plase type \"rm -rf /tmp/screens\" right after"
 echo installation, to avoid problems with permissions later.
else
  if killall -0 screen; then
    echo you seem to be upgrading from a pre-3.7 version of screen,
    echo but you still have screen-sessions running.
    echo This will cause problems with permissions of /tmp/screens,
    echo unless I remove this directory now.
    echo Unfortunately, if I remove /tmp/screens now, the running
    echo screen sessions will loose the ability to reattach.
    echo 
    echo Do you want me to remove /tmp/screens anyway "(adviced)",
    echo thereby cripling the current screen sessions, or shall I 
    echo leave screen unconfigured so that you can rerun the installtion
    echo later, when the screen sessions have ended?
    echo        type 
    echo " 1   to rm -rf /tmp/screens now"
    echo " 2   to leave screen unconfigured"
    read ans  
    if test "$ans" = "1"; then
      rm -rf /tmp/screens
    else
      exit 1
    fi
  else
    echo you seem to be upgrading from a pre-3.7 version of screen.
    echo "to avoid problems with permissions later, I'm now removing"
    echo '/tmp/screens (you should not notice this)'
    rm -rf /tmp/screens
  fi
fi




-- 
joost witteveen
            joost@rulcmc.leidenuniv.nl
          joostje@debian.org
--
Use Debian Linux!


Reply to: