~ubuntu-branches/debian/squeeze/ltsp/squeeze

« back to all changes in this revision

Viewing changes to client/screen_session

  • Committer: Bazaar Package Importer
  • Author(s): Vagrant Cascadian
  • Date: 2010-01-04 21:30:39 UTC
  • mfrom: (34.2.35 upstream)
  • Revision ID: james.westby@ubuntu.com-20100104213039-z5yw5ruzd23a300p
Tags: 5.1.98-1
* New upstream version:
  - Improved VT switching to reduce flicker and support multiple screens.
  - Improved methods to reboot/halt from within the session.
  - Updated Catalan (ca) translation by Jordà Polo (Closes: #56271).
  - ltsp-build-client plugins:
    + Partial support for cross-architecture mips and mipsel installs.
    + Error out when unable to select appropriate kernel.
    + Only allow sparc64 kernel on sparc.

* Updated use-test-binary patch.
* Remove patch to support wildcards in lts.conf, applied upstream.
* Update README.Debian to mention new options for cross-architecture
  installation.
* ltsp-server: Suggest qemu-user-static for building foreign architecture
  LTSP chroots.
* Sync ltsp-client-builder improvements developed by the Debian-Edu project:
  + Log which server packages are getting installed.
  + Wait for the backgrounded ltsp-build-client process to stop.
  + Ensure that open file descriptors do not cause debconf race conditions:
    redirect file descriptor 3 to /dev/null, and 4-9 to file descriptor 3.
  + Implement a stamp file for when ltsp-build-client fails to run.
  + Remove code no longer needed to preseed the keymap.
  + Fix bug in debconf handling to disable CDROM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    . /usr/share/ltsp/ltsp_config
40
40
fi
41
41
 
 
42
CURTTY="/dev/tty$(fgconsole)"
 
43
case $CURTTY in
 
44
    /dev/tty?) CURRENT_NUM="0${CURTTY##/dev/tty}" ;;
 
45
    /dev/tty??) CURRENT_NUM="${CURTTY##/dev/tty}" ;;
 
46
esac
 
47
CURTTY_NUM=${CURRENT_NUM#0}
 
48
 
42
49
# Figure out SCREEN_NUM
43
50
if [ -n "$1" ]; then
44
51
    SCREEN_NUM="$1"
48
55
else
49
56
    # If screen_session is called from inittab/upstart, already with a
50
57
    # controlling terminal, then just figure out what screen number we are.
51
 
    TTY=`tty`
52
 
    case $TTY in
53
 
        /dev/tty?) SCREEN_NUM="0${TTY##/dev/tty}" ;;
54
 
        /dev/tty??) SCREEN_NUM="${TTY##/dev/tty}" ;;
55
 
    esac
 
58
    SCREEN_NUM=${CURRENT_NUM}
 
59
    TTY_NUM=${CURTTY_NUM}
 
60
    TTY=${CURTTY}
56
61
fi
57
62
 
58
63
export SCREEN_NUM
69
74
main() {
70
75
    if [ -f /etc/ltsp/getltscfg-cluster.conf ]; then
71
76
        # Reset the environement
72
 
        unset $(env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|PATH|HOME|SCREEN_NUM|SCREEN_DIRS|TTY_NUM' | /usr/bin/cut -d= -f1)
 
77
        unset $(env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|PATH|HOME|SCREEN_NUM|SCREEN_DIRS|TTY_NUM|CURTTY_NUM' | /usr/bin/cut -d= -f1)
73
78
        . /usr/share/ltsp/ltsp_config
74
79
        eval $(getltscfg-cluster -a -l prompt)
75
80
    fi
96
101
            else
97
102
                return 2
98
103
            fi
99
 
            ${openvt} -f -w -c ${TTY_NUM} -- ${SCRIPT_DIR}/${SCREEN_SCRIPT} ${SCREEN_ARGS}
 
104
 
 
105
            # Check if we need to switch VT
 
106
            if [ "${CURTTY_NUM}" != "${TTY_NUM}" ]; then
 
107
                ${openvt} -f -w -c ${TTY_NUM} -- ${SCRIPT_DIR}/${SCREEN_SCRIPT} ${SCREEN_ARGS}&
 
108
                PID=$!
 
109
 
 
110
                # Check if our current VT has a screen configured, if so, make sure we stay there
 
111
                eval CURRENT_CMD=\$\{SCREEN_$CURRENT_NUM\}
 
112
                if [ -n "${CURRENT_CMD}" ]; then
 
113
                    chvt ${CURTTY_NUM}
 
114
                fi
 
115
                wait $PID
 
116
            else
 
117
                ${SCRIPT_DIR}/${SCREEN_SCRIPT} ${SCREEN_ARGS}
 
118
            fi
100
119
            return 0
101
120
        fi
102
121
    done