Browse code

Fix swift restart error

'swift-init all {restart|stop}' exits with '1' if there are any problems
sutting down any swift server, including if they were not running to begin with.
An attempt to address this has already been ignored by the Swift team, and it
would not have completely eliminated the problem, so we'll just be defensive here.

Change-Id: Ib8e30221e1c8873d0e849add89dc87d5ccda9d82

Dean Troyer authored on 2012/03/16 23:23:23
Showing 1 changed files
... ...
@@ -1182,10 +1182,12 @@ if is_service_enabled swift; then
1182 1182
    # We then can start rsync.
1183 1183
    sudo /etc/init.d/rsync restart || :
1184 1184
 
1185
-   # With swift-init we are first spawning all the swift services but kill the
1185
+   # First spawn all the swift services then kill the
1186 1186
    # proxy service so we can run it in foreground in screen.
1187
-   swift-init all restart
1188
-   swift-init proxy stop
1187
+   # ``swift-init ... {stop|restart}`` exits with '1' if no servers are running,
1188
+   # ignore it just in case
1189
+   swift-init all restart || true
1190
+   swift-init proxy stop || true
1189 1191
 
1190 1192
    unset s swift_hash swift_auth_server
1191 1193
 fi