Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
cda4d688
Commit
cda4d688
authored
Aug 28, 2013
by
Rovanion
Committed by
GitLab
Aug 28, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed failure to stop and added handling of failure to remove stale pid
parent
f57944cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
lib/support/init.d/gitlab
lib/support/init.d/gitlab
+17
-7
No files found.
lib/support/init.d/gitlab
View file @
cda4d688
...
...
@@ -20,8 +20,8 @@ RAILS_ENV="production"
# Script variable names should be lower-case not to conflict with internal
# /bin/sh variables such as PATH, EDITOR or SHELL.
app_root
=
"/home/git
lab
/gitlab"
app_user
=
"git
lab
"
app_root
=
"/home/git/gitlab"
app_user
=
"git"
unicorn_conf
=
"
$app_root
/config/unicorn.rb"
pid_path
=
"
$app_root
/tmp/pids"
socket_path
=
"
$app_root
/tmp/sockets"
...
...
@@ -76,10 +76,14 @@ check_status(){
if
[
$wpid
-ne
0
]
;
then
kill
-0
"
$wpid
"
2>/dev/null
web_status
=
"
$?
"
else
web_status
=
"-1"
fi
if
[
$spid
-ne
0
]
;
then
kill
-0
"
$spid
"
2>/dev/null
sidekiq_status
=
"
$?
"
else
sidekiq_status
=
"-1"
fi
}
...
...
@@ -89,12 +93,18 @@ check_stale_pids(){
# If there is a pid it is something else than 0, the service is running if
# *_status is == 0.
if
[
"
$wpid
"
!=
"0"
-a
"
$web_status
"
!=
"0"
]
;
then
echo
"Found stale Unicorn web server pid, removing. This is most likely caused by the web server crashing the last time it ran."
rm
"
$web_server_pid_path
"
echo
"Removing stale Unicorn web server pid. This is most likely caused by the web server crashing the last time it ran."
if
!
rm
"
$web_server_pid_path
"
;
then
echo
"Unable to remove stale pid, exiting"
exit
1
fi
fi
if
[
"
$spid
"
!=
"0"
-a
"
$sidekiq_status
"
!=
"0"
]
;
then
echo
"Found stale Sidekiq web server pid, removing. This is most likely caused by the Sidekiq crashing the last time it ran."
rm
"
$sidekiq_pid_path
"
echo
"Removing stale Sidekiq web server pid. This is most likely caused by the Sidekiq crashing the last time it ran."
if
!
rm
"
$sidekiq_pid_path
"
;
then
echo
"Unable to remove stale pid, exiting"
exit
1
fi
fi
}
...
...
@@ -205,7 +215,7 @@ reload(){
echo
"Done."
echo
"Restarting GitLab Sidekiq since it isn't capable of reloading it's config..."
RAILS_ENV
=
$RAILS_ENV
bundle
exec
rake sidekiq:stop
echo
"Starting Sidekiq..."
echo
"Starting Sidekiq..."
RAILS_ENV
=
$RAILS_ENV
bundle
exec
rake sidekiq:start
# Waiting 2 seconds for sidekiq to write it.
sleep
2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment