Comment 6 for bug 360759

Revision history for this message
Jim MacKenzie (jim-photojim) wrote :

I haven't edited it. This is a plain (and recent - maybe 3-month-old) Intrepid server install.

/usr/bin/screen:

#!/bin/sh
#
# screen wrapper script
# Copyright (C) 2008 Canonical Ltd.
#
# Authors: Dustin Kirkland <email address hidden>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Create the screen-profiles directory, if it doesn't already exist
[ -d "$HOME/.screen-profiles" ] || mkdir -p "$HOME/.screen-profiles"

# If $HOME/.screenrc exists but $HOME/.screen-profiles/profile does not,
# this shows that the user has an existing custom screen configuration,
# and thus we will not bother them with a select-screen-profile prompt.
if [ -r "$HOME/.screenrc" -a ! -e "$HOME/.screen-profiles/profile" -a ! -h "$HOME/.screen-profiles/profile" ]; then
        exec /usr/bin/screen.real -c "$HOME/.screenrc" "$@"
        exit $?
fi

# Ensure that the user has selected a screen profile
[ -h "$HOME/.screen-profiles/profile" ] || /usr/bin/select-screen-profile
if [ ! -r "$HOME/.screen-profiles/profile" ]; then
        echo
        echo "Your selected profile is not accessible."
        echo
        echo "Either select a different profile:"
        echo " $ select-screen-profile"
        echo
        echo "Or install the extras package:"
        echo " $ sudo apt-get install screen-profiles-extras"
        echo
        exit 1
fi

# Ensure that their keybindings are seeded
[ -s "$HOME/.screen-profiles/keybindings" ] || echo "source /usr/share/screen-profiles/keybindings/common" > "$HOME/.screen-profiles/keybindings"

# Ensure that their default windows are seeded
[ -r "$HOME/.screen-profiles/windows" ] || cp "/usr/share/screen-profiles/windows/common" "$HOME/.screen-profiles/windows"

# Ensure that the user's .screenrc at least exists
[ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc"

# Now let's execute screen!
exec /usr/bin/screen.real -c "$HOME/.screen-profiles/profile" "$@"

Also, in case it's useful:

$ time screen /bin/true

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/

  System information as of Tue Apr 14 13:00:01 CST 2009

  System load: 0.02 Memory usage: 30% Processes: 150
  Usage of /home: 26.5% of 182.88GB Swap usage: 0% Users logged in: 1

  => There is 1 zombie process.

  Graph this data and manage this system at https://landscape.canonical.com/
jim@adelaide:~$ ps aux | grep true
jim 10034 0.1 0.1 4084 1076 pts/9 S+ 13:05 0:00 /usr/bin/screen.real -c /home/jim/.screen-profiles/profile /bin/true
jim 10035 0.8 0.2 5264 2360 ? Ss 13:05 0:00 /usr/bin/SCREEN.real -c /home/jim/.screen-profiles/profile /bin/true
jim 10440 0.0 0.0 3236 792 pts/11 S+ 13:05 0:00 grep true
jim@adelaide:~$