This creates /etc/tgt/stack.d as a symlink to the cinder volumes
directory and includes it in /etc/tgt/targets.conf in a similar way
to /etc/tgt/conf.d
targets.conf only gets appended to when the symlink is created.
Any old /etc/tgt/conf.d/stack.conf is deleted
Change-Id: Ifb6412f6860ceb28b724644fb9b618638f552102
Fixes: bug #1072121
| ... | ... |
@@ -373,21 +373,20 @@ function install_cinderclient() {
|
| 373 | 373 |
setup_develop $CINDERCLIENT_DIR |
| 374 | 374 |
} |
| 375 | 375 |
|
| 376 |
-# apply config.d approach (e.g. Oneiric does not have this) |
|
| 376 |
+# apply config.d approach for cinder volumes directory |
|
| 377 | 377 |
function _configure_tgt_for_config_d() {
|
| 378 |
- if [[ ! -d /etc/tgt/conf.d/ ]]; then |
|
| 379 |
- sudo mkdir -p /etc/tgt/conf.d |
|
| 380 |
- echo "include /etc/tgt/conf.d/*.conf" | sudo tee -a /etc/tgt/targets.conf |
|
| 378 |
+ if [[ ! -d /etc/tgt/stack.d/ ]]; then |
|
| 379 |
+ sudo ln -sf $CINDER_STATE_PATH/volumes /etc/tgt/stack.d |
|
| 380 |
+ echo "include /etc/tgt/stack.d/*" | sudo tee -a /etc/tgt/targets.conf |
|
| 381 | 381 |
fi |
| 382 | 382 |
} |
| 383 | 383 |
|
| 384 | 384 |
# start_cinder() - Start running processes, including screen |
| 385 | 385 |
function start_cinder() {
|
| 386 | 386 |
if is_service_enabled c-vol; then |
| 387 |
+ # Delete any old stack.conf |
|
| 388 |
+ sudo rm -f /etc/tgt/conf.d/stack.conf |
|
| 387 | 389 |
_configure_tgt_for_config_d |
| 388 |
- if [[ ! -f /etc/tgt/conf.d/stack.conf ]]; then |
|
| 389 |
- echo "include $CINDER_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/stack.conf |
|
| 390 |
- fi |
|
| 391 | 390 |
if is_ubuntu; then |
| 392 | 391 |
# tgt in oneiric doesn't restart properly if tgtd isn't running |
| 393 | 392 |
# do it in two steps |