Commit 98ea81e65956cb37fc67c03e3a88c29c6932b12c

Authored by Rovanion
Committed by Rovanion Luckey
1 parent cda4d688

Restart works again, grammar mistakes corrected.

Showing 1 changed file with 16 additions and 5 deletions   Show diff stats
lib/support/init.d/gitlab
... ... @@ -188,7 +188,11 @@ stop() {
188 188  
189 189 # Returns the status of GitLab and it's components
190 190 status() {
191   - exit_if_not_running
  191 + check_status
  192 + if [ "$web_status" != "0" -a "$sidekiq_status" != "0" ]; then
  193 + echo "GitLab is not running."
  194 + return
  195 + fi
192 196 if [ "$web_status" = "0" ]; then
193 197 echo "The GitLab Unicorn webserver with pid $wpid is running."
194 198 else
... ... @@ -207,13 +211,13 @@ status() {
207 211 reload(){
208 212 exit_if_not_running
209 213 if [ "$wpid" = "0" ];then
210   - echo "The GitLab Unicorn Web server is not running thus it's configuration can't be reloaded."
  214 + echo "The GitLab Unicorn Web server is not running thus its configuration can't be reloaded."
211 215 exit 1
212 216 fi
213 217 printf "Reloading GitLab Unicorn configuration... "
214 218 kill -USR2 "$wpid"
215 219 echo "Done."
216   - echo "Restarting GitLab Sidekiq since it isn't capable of reloading it's config..."
  220 + echo "Restarting GitLab Sidekiq since it isn't capable of reloading its config..."
217 221 RAILS_ENV=$RAILS_ENV bundle exec rake sidekiq:stop
218 222 echo "Starting Sidekiq..."
219 223 RAILS_ENV=$RAILS_ENV bundle exec rake sidekiq:start
... ... @@ -222,6 +226,14 @@ reload(){
222 226 status
223 227 }
224 228  
  229 +restart(){
  230 + check_status
  231 + if [ "$web_status" = "0" -o "$sidekiq_status" = "0" ]; then
  232 + stop
  233 + fi
  234 + start
  235 +}
  236 +
225 237  
226 238 ## Finally the input handling.
227 239  
... ... @@ -233,8 +245,7 @@ case "$1" in
233 245 stop
234 246 ;;
235 247 restart)
236   - stop
237   - start
  248 + restart
238 249 ;;
239 250 reload|force-reload)
240 251 reload
... ...