forked from canonical/microceph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: wait until config has settled before starting services
Ensure ceph.conf points to the correct run dir Fixes: canonical#356 Signed-off-by: Peter Sabaini <[email protected]>
- Loading branch information
Showing
7 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
wait_for_config() { | ||
|
||
local confpath="${SNAP_DATA}/conf/ceph.conf" | ||
local search_str="^run dir = ${SNAP_DATA}/run" | ||
local max_attempts=300 | ||
local attempt=0 | ||
|
||
while [ $attempt -lt $max_attempts ]; do | ||
if [ -f "${confpath}" ]; then | ||
if grep -q "${search_str}" "${confpath}"; then | ||
return 0 | ||
fi | ||
fi | ||
attempt=$((attempt + 1)) | ||
sleep 2 | ||
done | ||
|
||
echo "No updated conf found in ${confpath}" | ||
return 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
#!/bin/sh | ||
|
||
. "${SNAP}/commands/common" | ||
|
||
wait_for_config | ||
|
||
exec ceph-mds -f --cluster ceph --id "$(hostname)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
#!/bin/sh | ||
|
||
. "${SNAP}/commands/common" | ||
|
||
wait_for_config | ||
|
||
exec ceph-mgr -f --cluster ceph --id "$(hostname)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
#!/bin/sh | ||
|
||
. "${SNAP}/commands/common" | ||
|
||
wait_for_config | ||
|
||
exec ceph-mon -f --cluster ceph --id "$(hostname)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/bin/sh | ||
|
||
exec "${SNAP}/bin/rados" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters