Start tgtd service after installing the rpm

The later call to tgtadm needs the daemon to be running, and the rpm
package doesn't start it.

Rebased and add a corresponding change for cinder.

Change-Id: Ia72b935575ed8b7c635e8f8edeea835754b2d49f
This commit is contained in:
Vincent Untz 2012-06-14 08:51:01 +02:00 committed by Dean Troyer
parent bff593d928
commit 0230aa899b
2 changed files with 10 additions and 0 deletions

View File

@ -106,6 +106,11 @@ function init_cinder() {
fi fi
if sudo vgs $VOLUME_GROUP; then if sudo vgs $VOLUME_GROUP; then
if [[ "$os_PACKAGE" = "rpm" ]]; then
# RPM doesn't start the service
start_service tgtd
fi
# Remove iscsi targets # Remove iscsi targets
sudo tgtadm --op show --mode target | grep $VOLUME_NAME_PREFIX | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true sudo tgtadm --op show --mode target | grep $VOLUME_NAME_PREFIX | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true
# Clean out existing volumes # Clean out existing volumes

View File

@ -1704,6 +1704,11 @@ elif is_service_enabled n-vol; then
fi fi
if sudo vgs $VOLUME_GROUP; then if sudo vgs $VOLUME_GROUP; then
if [[ "$os_PACKAGE" = "rpm" ]]; then
# RPM doesn't start the service
start_service tgtd
fi
# Remove nova iscsi targets # Remove nova iscsi targets
sudo tgtadm --op show --mode target | grep $VOLUME_NAME_PREFIX | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true sudo tgtadm --op show --mode target | grep $VOLUME_NAME_PREFIX | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true
# Clean out existing volumes # Clean out existing volumes