~ubuntu-branches/debian/sid/ltsp/sid

« back to all changes in this revision

Viewing changes to client/initscripts/ltsp-setup

  • Committer: Bazaar Package Importer
  • Author(s): Vagrant Cascadian
  • Date: 2009-07-18 00:51:50 UTC
  • mfrom: (34.2.26 upstream)
  • Revision ID: james.westby@ubuntu.com-20090718005150-0c0j1n7cywz92itm
Tags: 5.1.77-1
* new upstream version:
  - ltsp-update-image:
    + Do not remove the previous squashfs image before the new one is ready.
    + Handle mksquashfs errors and small code cleanup.
    + Add --no-comp to support non-compressed squashfs image.

  - initramfs-tools ltsp_nbd:
    + Default to using NBD_ROOT_SERVER when setting NBD_SWAP_SERVER and
      fetching lts.conf from tftp.
    + initramfs-tools ltsp_nbd hook: allow for other filesystems for the rofs
      mount.
    + Issue warnings when NBD fails to negotiate or mount.
    + Fix downloading of lts.conf file by using the full path to tftp,
      otherwise busybox's tftp is used, which has incompatible syntax. thanks
      to Tobias Gruetzmacher for the suggestion. (Closes: #537374)

  - Add lts.conf support for shutdown times and more general crontab entries.

  - Merge changes to improve NBD support in initscripts.

  - Flexible pxelinux network boot:
    + Options to configure menus.
    + Configurable timeout.
    + Option to append arbitrary files to the configuration.
    + Support pxelinux ipappend option, useful in networks where control over
      the dhcp server is limited.
    + Add memtest86 and memtest86+ for memory testing, if installed.

  - ltsp-build-client improvements to NBD support:
    + Fix squashfs-image plugin to add the appropriate module packages when
      using a specified kernel or an unusual architecture.
    + Set KILLALL=false in nbd-client configuration so nbd root doesn't get
      disconnected before shutdown is completed.
    + Whitelist nbd-client init scripts.

* Remove Otavio Salvador from uploaders, at Otavio's request. many thanks for
  all previous and future contributions!

* Updated example screen.d script for sdm.

* Update Standards-Version to 3.8.2, no changes necessary. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
#
3
 
# Author:       Matt Zimmerman <mdz@ubuntu.com>
 
3
# Author:   Matt Zimmerman <mdz@ubuntu.com>
4
4
#
5
5
### BEGIN INIT INFO
6
6
# Provides:          ltsp-client-setup
33
33
    done
34
34
}
35
35
 
 
36
configure_nbd() {
 
37
    # Restart nbd so -persist will work
 
38
    nbdcmd=`pgrep -l -f "/dev/nbd0 -persist" | cut -d " " -f "2-"`
 
39
    if [ -n "$nbdcmd" ]; then
 
40
        nbd-client -d /dev/nbd0
 
41
        nbd-client -c /dev/nbd0
 
42
        while [ "$?" != "1" ]; do
 
43
            nbd-client -c /dev/nbd0
 
44
        done
 
45
        $nbdcmd
 
46
    fi
 
47
}
 
48
 
36
49
configure_localdev() {
37
50
    boolean_is_true "$LOCALDEV" && mkdir -p /var/run/drives
38
51
}
91
104
    fi
92
105
}
93
106
 
 
107
configure_cron() {
 
108
    CRON_FILE=/etc/cron.d/ltsp
 
109
    if [ ! -w "/etc/cron.d" ]; then
 
110
        echo "Warning: /etc/cron.d is not writeable."
 
111
        return 1
 
112
    fi
 
113
    if [ -n "$SHUTDOWN_TIME" ] ; then
 
114
        echo $SHUTDOWN_TIME | awk -F : '{print $2" "$1" * * * root test ! -S $(ls -1 /var/run/ldm_socket_* | head -1) && halt" }' >> $CRON_FILE
 
115
    fi
 
116
    for ltsconf in /etc/lts.conf /var/cache/getltscfg-cluster/lts.conf; do
 
117
        if [ -f $ltsconf ]; then
 
118
            cat $ltsconf | grep -E "^CRONTAB_[0-9]{2}=" | sed -e "s/.*[0-9]\{2\}=\"//g" -e "s/\"$//g" >> $CRON_FILE
 
119
        fi
 
120
    done
 
121
}
 
122
 
94
123
bind_mounts () {
95
124
    # set defaults
96
125
    test -z "$tmpfs_dir" && tmpfs_dir=/var/lib/ltsp-client-setup
143
172
case "$1" in
144
173
    start)
145
174
        log_begin_msg "Setting up LTSP client..."
146
 
        if type usplash_write >/dev/null 2>/dev/null ; then
 
175
        which usplash_write >/dev/null 2>/dev/null && \
147
176
            usplash_write "TIMEOUT 120" || true
148
 
        fi
149
177
        if [ -z "$root_write_method" ] && [ ! -w "/" ]; then
150
178
            root_write_method="bind_mounts"
151
179
        fi
155
183
            eval $(getltscfg-cluster -a -l refresh) || true
156
184
        fi
157
185
        load_modules || true
 
186
        configure_resolver || true
 
187
        #configure_nbd || true FIXME: Disable it for now as it doesn't work with unionfs-fuse
158
188
        set_time || true
159
189
        configure_console || true
160
 
        configure_resolver || true
161
190
        configure_swap || true
162
191
        configure_syslog || true
163
192
        configure_fstab || true
 
193
        configure_cron || true
164
194
        run_rcfiles || true
165
195
        configure_serial_mouse || true
166
196
        configure_localdev || true
167
197
        configure_printer || true
168
 
            [ "$root_write_method" = "bind_mounts" ] && bind_unmounts
 
198
        [ "$root_write_method" = "bind_mounts" ] && bind_unmounts
169
199
        log_end_msg 0
170
 
            ;;
 
200
        ;;
171
201
    stop)
172
 
        #       echo -n "Stopping $DESC: $NAME"
173
 
        #       d_stop
174
 
        #       echo "."
175
 
            ;;
 
202
        #   echo -n "Stopping $DESC: $NAME"
 
203
        #   d_stop
 
204
        #   echo "."
 
205
        ;;
176
206
    restart|force-reload)
177
 
            #
178
 
            #   If the "reload" option is implemented, move the "force-reload"
179
 
        #       option to the "reload" entry above. If not, "force-reload" is
180
 
            #   just the same as "restart".
181
 
            #
182
 
            echo -n "Restarting $DESC: $NAME"
183
 
            d_stop
184
 
            sleep 1
185
 
            d_start
186
 
            echo "."
187
 
            ;;
 
207
        #
 
208
        #   If the "reload" option is implemented, move the "force-reload"
 
209
        #   option to the "reload" entry above. If not, "force-reload" is
 
210
        #   just the same as "restart".
 
211
        #
 
212
        echo -n "Restarting $DESC: $NAME"
 
213
        d_stop
 
214
        sleep 1
 
215
        d_start
 
216
        echo "."
 
217
        ;;
188
218
    *)
189
 
            echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
190
 
            exit 1
191
 
            ;;
 
219
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
 
220
        exit 1
 
221
        ;;
192
222
esac
193
223
 
194
224
exit 0