2
# $Id: init,v 1.3 2004/03/16 01:43:45 zal Exp $
4
# Script to remove stale screen named pipes on bootup.
8
# Provides: screen-cleanup
9
# Required-Start: $remote_fs
10
# Required-Stop: $remote_fs
13
# Short-Description: screen sessions cleaning
14
# Description: Cleans up the screen session directory and fixes its
15
# permissions if needed.
20
test -f /usr/bin/screen || exit 0
22
SCREENDIR=/var/run/screen
26
if test -L $SCREENDIR || ! test -d $SCREENDIR; then
29
chown root:utmp $SCREENDIR
30
[ -x /sbin/restorecon ] && /sbin/restorecon $SCREENDIR
32
find $SCREENDIR -type p -delete
33
# If the local admin has used dpkg-statoverride to install the screen
34
# binary with different set[ug]id bits, change the permissions of
35
# $SCREENDIR accordingly
36
BINARYPERM=`stat -c%a /usr/bin/screen`
37
if [ "$BINARYPERM" -ge 4000 ]; then
39
elif [ "$BINARYPERM" -ge 2000 ]; then
45
stop|restart|reload|force-reload)