projects
/
grml-scripts-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
grml-screen: use much simpler fix to mitigate raceconditions from screen
[grml-scripts-core.git]
/
usr_bin
/
grml-screen
diff --git
a/usr_bin/grml-screen
b/usr_bin/grml-screen
index
cd40503
..
d6413e0
100755
(executable)
--- a/
usr_bin/grml-screen
+++ b/
usr_bin/grml-screen
@@
-4,7
+4,6
@@
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Mär 21 15:39:00 CET 2007 [mika]
################################################################################
# export variable USER for use withing GNU screen:
################################################################################
# export variable USER for use withing GNU screen:
@@
-15,16
+14,23
@@
sudo chmod 660 $TTY
sudo chown $USER.tty $TTY
sudo chmod 660 $TTY
sudo chown $USER.tty $TTY
+# try to mitigate raceconditions from screen
+SCREENDIR_="/var/run/screen"
+if [ `id -u` = 0 ] ; then
+ mkdir -m 755 $SCREENDIR_
+ chgrp utmp $SCREENDIR_
+fi
+mkdir -m 700 "${SCREENDIR_}/S-$USER" &>/dev/null
+
# now run screen with config
cd $HOME # important for e.g. hardcopy-feature
# now run screen with config
cd $HOME # important for e.g. hardcopy-feature
- # do we have a utf8 enabled terminal?
- [ -x /usr/bin/vt-is-UTF8 ] && /usr/bin/vt-is-UTF8 -q && UTF='-U'
+
if [ `id -u` = 0 ] ; then
if [ `id -u` = 0 ] ; then
- exec screen
$UTF
-c /etc/grml/screenrc
+ exec screen
-U
-c /etc/grml/screenrc
elif [ -r "$HOME/.screenrc" ] ; then
elif [ -r "$HOME/.screenrc" ] ; then
- exec screen
$UTF
-c "$HOME/.screenrc"
+ exec screen
-U
-c "$HOME/.screenrc"
else
else
- exec screen
$UTF
-c /etc/grml/screenrc_grml
+ exec screen
-U
-c /etc/grml/screenrc_grml
fi
## END OF FILE #################################################################
fi
## END OF FILE #################################################################