source: trunk/debathena/config/reactivate/debian/debathena-reactivate.init @ 25772

Revision 25772, 1.5 KB checked in by jdreed, 12 years ago (diff)
In reactivate: * Bump the chroot's ramdisk to 50% of RAM or 1G, whichever is higher (Trac: #1207)
  • Property svn:executable set to *
Line 
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides:          debathena-reactivate
4# Required-Start:
5# Required-Stop:
6# Default-Start:     2 3 4 5
7# Default-Stop:
8# X-Start-Before:    gdm
9# Short-Description: Re-activate Athena cluster machine
10# Description:       This script sets up an Athena cluster machine at boot.
11#                    Currently, it mutes the sound and sets up a filesystem
12#                    for snapshots.
13### END INIT INFO
14
15PATH=/sbin:/bin:/usr/bin
16
17case "$1" in
18  start)
19        # Clean up the per-user files cached locally by gdm.
20        rm -rf /var/cache/gdm/*
21
22        # Set the volume to zero for all sound cards, and save that state.
23        (/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        tmpfssize="50%"
29        if [ "$(machtype -M)" -le 2007518 ]; then
30            tmpfssize="1073741824"
31        fi
32        if ! mountpoint -q /var/lib/schroot/union/overlay; then
33            mount -t tmpfs -o size="$tmpfssize" tmpfs /var/lib/schroot/union/overlay
34        fi
35
36        # Enable subtree operations on /media by making it a mount point,
37        # then share it.
38        media_mount=$(mount | awk '$1 == "/media" && $3 == "/media"')
39        if [ -z "$media_mount" ]; then
40            mount --bind /media /media
41            mount --make-shared /media
42        fi
43        ;;
44  restart|reload|force-reload)
45        echo "Error: argument '$1' not supported" >&2
46        exit 3
47        ;;
48  stop)
49        # No-op
50        ;;
51  *)
52        echo "Usage: $0 start|stop" >&2
53        exit 3
54        ;;
55esac
56
57:
Note: See TracBrowser for help on using the repository browser.