~ubuntu-branches/ubuntu/precise/ceph/precise

« back to all changes in this revision

Viewing changes to src/mkcephfs.in

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum, Clint Byrum, Micah Gersten
  • Date: 2011-02-12 22:50:26 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110212225026-yyyw4tk0msgql3ul
Tags: 0.24.2-0ubuntu1
[ Clint Byrum <clint@ubuntu.com> ]
* New upstream release. (LP: #658670, LP: #684011)
* debian/patches/fix-mkcephfs.patch: dropped (applied upstream)
* Removed .la files from libceph1-dev, libcrush1-dev and 
  librados1-dev (per Debian policy v3.9.1 10.2).
* debian/control: adding pkg-config as a build dependency
* debian/control: depend on libcrypto++-dev instead of libssl-dev
* debian/watch: added watch file

[ Micah Gersten <micahg@ubuntu.com> ]
* debian/control: add Homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
else
10
10
    BINDIR=@bindir@
11
11
    LIBDIR=@libdir@/ceph
12
 
    # i hate autoconf:
13
 
    if [ "@sysconfdir@" = "/usr/etc" ]; then
14
 
        ETCDIR=/etc/ceph
15
 
    else
16
 
        ETCDIR=@sysconfdir@/ceph
17
 
    fi
 
12
    ETCDIR=@sysconfdir@/ceph
18
13
fi
19
14
 
20
15
usage_exit() {
85
80
 
86
81
[ -z "$conf" ] && usage_exit
87
82
 
 
83
if [ $allhosts -eq 0 ]; then
 
84
    echo "mkcephfs currently requires -a|--allhosts to initialize the whole fs at once."
 
85
    usage_exit
 
86
fi
 
87
 
 
88
if [ -z "$adminkeyring" ]; then
 
89
    echo "mkcephfs requires '-k /path/to/admin/keyring'. default location is /etc/ceph/keyring.bin."
 
90
    usage_exit
 
91
fi
 
92
 
88
93
verify_conf
89
94
 
90
95
get_name_list "$@"
91
96
 
92
 
# create the monmap if we're doing mon0
93
 
if echo $what | grep -q mon0 ; then
 
97
# do core fs initialization steps
 
98
if true; then
94
99
    # first, make a list of monitors
95
100
    mons=`$CCONF -c $conf -l mon | egrep -v '^mon$' | sort`
96
101
    args=""
99
104
    for name in $mons; do
100
105
        id=`echo $name | cut -c 4- | sed 's/\\.//'`
101
106
        get_conf addr "" "mon addr"
102
 
        args=$args" --add $addr"
 
107
        args=$args" --add $id $addr"
103
108
    done
104
109
 
105
110
    # build monmap
117
122
    $BINDIR/osdmaptool --clobber --createsimple $numosd $osdmap || exit 1
118
123
 
119
124
    # import crush map?
120
 
    get_conf crushmapsrc "$usecrushmapsrc" "crush map src" mon0 mon global
 
125
    get_conf crushmapsrc "$usecrushmapsrc" "crush map src" mon global
121
126
    if [ -n "$crushmapsrc" ]; then
122
127
        echo Compiling crush map from $crushmapsrc to $crushmap
123
128
        crushmap="/tmp/crushmap.$$"
124
129
        $BINDIR/crushtool -c $crushmapsrc -o $crushmap
125
130
    fi
126
 
    get_conf crushmap "$usecrushmap" "crush map" mon0 mon global
 
131
    get_conf crushmap "$usecrushmap" "crush map" mon global
127
132
    if [ -n "$crushmap" ]; then
128
133
        echo Importing crush map from $crushmap
129
134
        $BINDIR/osdmaptool --clobber --import-crush $crushmap $osdmap
132
137
    # admin keyring
133
138
    [ -z "$adminkeyring" ] && adminkeyring="/tmp/admin.keyring.$$"
134
139
    echo Building admin keyring at $adminkeyring
135
 
    cat <<EOF > /tmp/admin_caps.$$
136
 
; generated by mkcephfs on `date`
137
 
        mon = "allow *"
138
 
        osd = "allow *"
139
 
        mds = "allow"
140
 
EOF
141
140
    [ -e "$monkeyring" ] && rm -f $monkeyring
142
 
    $BINDIR/cauthtool --create-keyring --gen-key --name=client.admin --set-uid=0 --caps=/tmp/admin_caps.$$ $adminkeyring
143
 
    rm -f /tmp/admin_caps.$$
 
141
    $BINDIR/cauthtool --create-keyring --gen-key --name=client.admin --set-uid=0 \
 
142
        --cap mon 'allow *' \
 
143
        --cap osd 'allow *' \
 
144
        --cap mds 'allow' \
 
145
        $adminkeyring
144
146
 
145
147
    # mon keyring (for monitor)
146
148
    echo Building monitor keyring with all service keys
149
151
 
150
152
    $BINDIR/cauthtool --import-keyring $adminkeyring $monkeyring
151
153
 
152
 
    cat <<EOF > /tmp/osd.caps.$$
153
 
; generated by mkcephfs on `date`
154
 
        mon = "allow rwx"
155
 
        osd = "allow *"
156
 
EOF
157
 
    cat <<EOF > /tmp/mds.caps.$$
158
 
; generated by mkcephfs on `date`
159
 
        mon = "allow rwx"
160
 
        osd = "allow *"
161
 
        mds = "allow"
162
 
EOF
163
 
 
164
154
    for name in $what; do
165
155
        type=`echo $name | cut -c 1-3`   # e.g. 'mon', if $name is 'mon1'
166
156
        id=`echo $name | cut -c 4- | sed 's/\\.//'`
167
157
 
168
158
        if [ "$type" = "osd" ]; then
169
 
            $BINDIR/cauthtool --create-keyring --gen-key --name=osd.$id --caps=/tmp/osd.caps.$$ /tmp/keyring.osd.$id
 
159
            $BINDIR/cauthtool --create-keyring --gen-key --name=osd.$id \
 
160
                --cap mon 'allow rwx' \
 
161
                --cap osd 'allow *' \
 
162
                /tmp/keyring.osd.$id
170
163
            $BINDIR/cauthtool --import-keyring /tmp/keyring.osd.$id $monkeyring
171
164
        fi
172
165
        if [ "$type" = "mds" ]; then
173
 
            $BINDIR/cauthtool --create-keyring --gen-key --name=mds.$id --caps=/tmp/mds.caps.$$ /tmp/keyring.mds.$id
 
166
            $BINDIR/cauthtool --create-keyring --gen-key --name=mds.$id \
 
167
                --cap mon 'allow rwx' \
 
168
                --cap osd 'allow *' \
 
169
                --cap mds 'allow' \
 
170
                /tmp/keyring.mds.$id
174
171
            $BINDIR/cauthtool --import-keyring /tmp/keyring.mds.$id $monkeyring
175
172
        fi
176
173
    done
206
203
            [ -n "$user" ] && chown $user $tmpkeyring
207
204
        fi
208
205
        get_conf mon_data "" "mon data"
209
 
        do_cmd "$BINDIR/cmon -c $conf --mkfs -i $num --monmap $monmap --osdmap $osdmap -k $tmpkeyring ; rm -f $tmpkeyring"
 
206
        do_cmd "$BINDIR/cmon -c $conf --mkfs -i $id --monmap $monmap --osdmap $osdmap -k $tmpkeyring ; rm -f $tmpkeyring"
210
207
 
211
208
        if [ -n "$ssh" ]; then
212
209
            if [ -n "$user" ]; then