Changeset 24125

Show
Ignore:
Timestamp:
10/25/09 01:21:27 (4 weeks ago)
Author:
geofft
Message:

In reactivate:

  • Rewrite to use schroot 1.3 and aufs union mounts instead of LVM. This makes logins on a Dell 760 take about 8 seconds to reach the desktop.
    • TODO: Reincorporate clean-up fallbacks (e.g. rebooting) of previous version.
    • TODO: Deal with manually modified /etc/schroot/schroot.conf.
Location:
trunk/debathena/config/reactivate/debian
Files:
3 added
1 removed
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/debathena/config/reactivate/debian/01debathena-reactivate-cleanup

    • Property svn:executable deleted
    r24057 r24125  
    66invoke-rc.d debathena-reactivate start 
    77 
    8 if [ "$(machtype -q)" != "quickstation" ]; then 
    9     # Clean up the login snapshot. 
    10     athena-login-snapshot login-end 
    11 fi 
     8# Restart necessary daemons outside the chroot 
     9daemons=$(/usr/bin/policy-rc.d --daemons) 
     10for daemon in $daemons; do 
     11    invoke-rc.d "$daemon" start || [ $? = 100 ] 
     12done 
     13 
     14rm /var/run/athena-login 
  • trunk/debathena/config/reactivate/debian/99debathena-reactivate-setup

    • Property svn:executable deleted
    r24057 r24125  
    22# gdm login session.  gdm blocks until it finishes. 
    33 
    4 if [ "$(machtype -q)" != "quickstation" ]; then 
    5     # Create a login chroot for this login session. 
    6     athena-login-snapshot login-start || exit 
    7 fi 
     4# Stop daemons that need to be restarted inside the chroot 
     5daemons=$(/usr/bin/policy-rc.d --daemons) 
     6for daemon in $daemons; do 
     7    invoke-rc.d "$daemon" stop || [ $? = 100 ] 
     8done 
     9 
     10touch /var/run/athena-login 
  • trunk/debathena/config/reactivate/debian/Xsession.debathena

    r24057 r24125  
    11#!/bin/sh 
    22 
    3 if [ "$(machtype -q)" != "quickstation" ]; then 
    4     # We wrap the Xsession in sudo because it runs initgroups(3) 
    5     # /after/ being chrooted, which puts users back in the groups we 
    6     # added them to in athena-login-snapshot 
    7     exec schroot -c login -p -- sudo -E -u "$USER" -- /etc/gdm/Xsession.debathena-orig "$@" 
    8 else 
    9     exec /etc/gdm/Xsession.debathena-orig "$@" 
    10 fi 
     3set -e 
     4 
     5addgroups="admin lpadmin adm fuse cdrom floppy audio video plugdev scanner dialout" 
     6daemons="$(/usr/sbin/policy-rc.d --daemons)" 
     7 
     8# Setup 
     9 
     10session=$(schroot -c login -b) 
     11for group in $addgroups; do 
     12    schroot -c "$session" -r -u root -- gpasswd -a "$USER" "$group" 
     13done 
     14 
     15schroot -c "$session" -r -u root -- sed -i "/su-error/d" "/etc/pam.d/su.debathena" 
     16 
     17for daemon in $daemons; do 
     18    schroot -c "$session" -r -u root -- invoke-rc.d "$daemon" start || [ $? = 100 ] 
     19done 
     20 
     21schroot -c "$session" -r -u root -- touch /ClusterLogin 
     22 
     23schroot -c "$session" -r -u root -- rm /etc/debian_chroot 
     24 
     25# Run the session 
     26# 
     27# We wrap the Xsession in sudo because it runs initgroups(3) 
     28# /after/ being chrooted, which puts users back in the groups we 
     29# added them to 
     30schroot -c "$session" -r -p -- sudo -E -u "$USER" -- /etc/gdm/Xsession.debathena-orig "$@" 
     31 
     32# Teardown 
     33 
     34for daemon in $daemons; do 
     35    schroot -c "$session" -r -u root -- invoke-rc.d "$daemon" stop || [ $? = 100 ] 
     36done 
     37 
     38schroot -c "$session" -e 
  • trunk/debathena/config/reactivate/debian/changelog

    r24093 r24125  
     1debathena-reactivate (2.0) UNRELEASED; urgency=low 
     2 
     3  * Rewrite to use schroot 1.3 and aufs union mounts instead of LVM. 
     4    This makes logins on a Dell 760 take about 8 seconds to reach the 
     5    desktop. 
     6    - TODO: Reincorporate clean-up fallbacks (e.g. rebooting) of previous 
     7      version. 
     8    - TODO: Deal with manually modified /etc/schroot/schroot.conf. 
     9 
     10 -- Geoffrey Thomas <geofft@mit.edu>  Sat, 24 Oct 2009 19:28:08 -0400 
     11 
    112debathena-reactivate (1.25.6) unstable; urgency=low 
    213 
  • trunk/debathena/config/reactivate/debian/control.in

    r24071 r24125  
    88Package: debathena-reactivate 
    99Architecture: all 
    10 Depends: schroot, lvm2, psmisc, gdm, alsa-utils, debathena-gdm-config (>= 1.14~), ${misc:Depends} 
     10Depends: debathena-schroot, psmisc, gdm, alsa-utils, debathena-gdm-config (>= 1.14~), sudo, ${misc:Depends} 
    1111Provides: ${diverted-files} 
    1212Conflicts: ${diverted-files} 
     
    1616 are erased after logout. 
    1717 . 
    18  This package is very much tailored to Athena cluster machines.  To 
    19  use it, the machine MUST be installed so that the root partition is a 
    20  logical volume inside a volume group with at least 21GB of free 
    21  space.  This script will, in certain exceptional conditions, reboot 
     18 This package is very much tailored to Athena cluster machines. 
     19 This script will, in certain exceptional conditions, reboot 
    2220 the machine in order to be able to unmount the login snapshot. 
  • trunk/debathena/config/reactivate/debian/debathena-reactivate.init

    r24093 r24125  
    99# Short-Description: Re-activate Athena cluster machine 
    1010# Description:       This script sets up an Athena cluster machine at boot. 
    11 #                    Currently, it just mutes the sound. 
     11#                    Currently, it mutes the sound and sets up a filesystem 
     12#                    for snapshots. 
    1213### END INIT INFO 
    1314 
     
    1516 
    1617. /lib/init/vars.sh 
     18. /lib/init/mount-functions.sh 
    1719 
    1820case "$1" in 
     
    2022        # Set the volume to zero for all sound cards, and save that state. 
    2123        (/etc/init.d/alsa-utils stop all && alsactl store) > /dev/null 2>&1 
     24 
     25        # Create a tmpfs where schroot puts overlays. This is needed 
     26        # because aufs won't let you put an overlay and underlay on the 
     27        # same file system. 
     28        domount tmpfs "" /var/lib/schroot/union/overlay tmpfs -osize=1073741824 
    2229        ;; 
    2330  restart|reload|force-reload) 
  • trunk/debathena/config/reactivate/debian/debathena-reactivate.install

    r24077 r24125  
    1 debian/athena-login-snapshot usr/sbin 
    21debian/Xsession.debathena etc/gdm 
    32debian/99debathena-reactivate-setup usr/share/debathena-gdm-config/PreSession.d 
     
    98debian/sudo-warning etc/athena 
    109debian/su-warning etc/athena 
     10debian/login etc/schroot/chroot.d 
     11debian/script-athena etc/schroot 
     12debian/mount-athena etc/schroot 
  • trunk/debathena/config/reactivate/debian/debathena-reactivate.postinst

    r24083 r24125  
    7272        # Users logging in will be added to several different 
    7373        # groups. Make sure they all exist. 
    74         for group in $(sed -ne 's/^addgroups="\(.*\)"/\1/p' /usr/sbin/athena-login-snapshot); do 
     74        for group in $(sed -ne 's/^addgroups="\(.*\)"/\1/p' /etc/gdm/Xsession.debathena); do 
    7575            getent group "$group" >/dev/null || addgroup --system "$group" 
    7676        done