blob: ff7de01958adaac77e9206d2eee318179ec64180 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#!/bin/sh
# $Id: init,v 1.3 2004/03/16 01:43:45 zal Exp $
#
# Script to remove stale screen named pipes on bootup.
#
### BEGIN INIT INFO
# Provides: screen-cleanup
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: screen sessions cleaning
### END INIT INFO
set -e
SCREENDIR=/tmp/.screen
case "$1" in
start)
rm -rf /var/run/screen
if ! test -d $SCREENDIR; then
rm -f $SCREENDIR
mkdir $SCREENDIR
chown root:utmp $SCREENDIR
fi
find $SCREENDIR -type p -print0 | xargs -0r rm -f --
# If the local admin has used dpkg-statoverride to install screen setuid,
# change the permissions of $SCREENDIR accordingly
if [ `stat -c%a /usr/bin/screen` -ge 4000 ]; then
chmod 0755 $SCREENDIR
else
chmod 0775 $SCREENDIR
fi
;;
stop|restart|reload|force-reload)
;;
esac
exit 0
|