~ubuntu-branches/ubuntu/gutsy/mdadm/gutsy

« back to all changes in this revision

Viewing changes to debian/startall

  • Committer: Package Import Robot
  • Author(s): Fabio M. Di Nitto
  • Date: 2006-11-20 06:56:19 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20061120065619-2sr98cpmlv8dcqzt
Tags: 2.5.6-5ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# startall -- starts all existing arrays after creating mdadm.conf
 
4
#             overrides the AUTOSTART variable in /etc/default/mdadm
 
5
#
 
6
# Copyright © martin f. krafft <madduck@madduck.net>
 
7
# distributed under the terms of the Artistic Licence 2.0
 
8
#
 
9
# $Id: startall 272 2006-11-11 19:54:38Z madduck $
 
10
#
 
11
 
 
12
set -eu
 
13
 
 
14
CONFIG=/etc/mdadm/mdadm.conf
 
15
ALTCONFIG=/etc/mdadm.conf
 
16
 
 
17
modprobe -kq md 2>/dev/null || :
 
18
 
 
19
if [ ! -f $CONFIG ] && [ ! -f $ALTCONFIG ]; then
 
20
  mkdir --parents ${CONFIG%/*}
 
21
  /usr/share/mdadm/mkconf > $CONFIG || ret=$?
 
22
  case ${ret:-0} in
 
23
    0) :;;
 
24
    255) echo W: mdadm: using existing mdadm.conf file... >&2;;
 
25
    *)
 
26
      echo E: mdadm: mdadm.conf creation failed, aborting. >&2
 
27
      exit $ret
 
28
      ;;
 
29
  esac
 
30
fi
 
31
 
 
32
MDADM_FORCE_AUTOSTART__=1 exec /etc/init.d/mdadm-raid start