summaryrefslogtreecommitdiffstats
path: root/debian/screen.init
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:20:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:20:21 +0000
commitef3904423d3301d87b4b499b7e5feb359d622405 (patch)
tree981032c10096a70b0cb95ea74de48492f9f08251 /debian/screen.init
parentAdding upstream version 4.6.2. (diff)
downloadscreen-10041a613a13113eb7fc6a0c04c9c176edf42ded.tar.xz
screen-10041a613a13113eb7fc6a0c04c9c176edf42ded.zip
Adding debian version 4.6.2-3+deb10u1.debian/4.6.2-3+deb10u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/screen.init')
-rw-r--r--debian/screen.init49
1 files changed, 49 insertions, 0 deletions
diff --git a/debian/screen.init b/debian/screen.init
new file mode 100644
index 0000000..3eb4185
--- /dev/null
+++ b/debian/screen.init
@@ -0,0 +1,49 @@
+#!/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: $remote_fs
+# Required-Stop: $remote_fs
+# Default-Start: S
+# Default-Stop:
+# Short-Description: screen sessions cleaning
+# Description: Cleans up the screen session directory and fixes its
+# permissions if needed.
+### END INIT INFO
+
+set -e
+
+test -f /usr/bin/screen || exit 0
+
+SCREENDIR=/run/screen
+
+case "$1" in
+start)
+ if test -L $SCREENDIR || ! test -d $SCREENDIR; then
+ rm -f $SCREENDIR
+ mkdir $SCREENDIR
+ chown root:utmp $SCREENDIR
+ [ -x /sbin/restorecon ] && /sbin/restorecon $SCREENDIR
+ fi
+ find $SCREENDIR -type p -delete
+# If the local admin has used dpkg-statoverride to install the screen
+# binary with different set[ug]id bits, change the permissions of
+# $SCREENDIR accordingly
+ BINARYPERM=`stat -c%a /usr/bin/screen`
+ if [ "$BINARYPERM" -ge 4000 ]; then
+ chmod 0755 $SCREENDIR
+ elif [ "$BINARYPERM" -ge 2000 ]; then
+ chmod 0775 $SCREENDIR
+ else
+ chmod 1777 $SCREENDIR
+ fi
+ ;;
+stop|restart|reload|force-reload)
+ ;;
+esac
+
+exit 0