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
36
49
configure_localdev() {
37
50
boolean_is_true "$LOCALDEV" && mkdir -p /var/run/drives
108
CRON_FILE=/etc/cron.d/ltsp
109
if [ ! -w "/etc/cron.d" ]; then
110
echo "Warning: /etc/cron.d is not writeable."
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
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
96
125
test -z "$tmpfs_dir" && tmpfs_dir=/var/lib/ltsp-client-setup
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
149
177
if [ -z "$root_write_method" ] && [ ! -w "/" ]; then
150
178
root_write_method="bind_mounts"
155
183
eval $(getltscfg-cluster -a -l refresh) || true
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
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
172
# echo -n "Stopping $DESC: $NAME"
202
# echo -n "Stopping $DESC: $NAME"
176
206
restart|force-reload)
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".
182
echo -n "Restarting $DESC: $NAME"
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".
212
echo -n "Restarting $DESC: $NAME"
189
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
219
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2