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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9501495a
Commit
9501495a
authored
Aug 19, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix init.d script.
parent
41fdd20c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
lib/support/init.d/gitlab
lib/support/init.d/gitlab
+15
-15
No files found.
lib/support/init.d/gitlab
View file @
9501495a
...
...
@@ -85,7 +85,7 @@ check_pids(){
wait_for_pids
(){
# We are sleeping a bit here mostly because sidekiq is slow at writing it's pid
i
=
0
;
while
[
!
-f
$web_server_pid_path
]
||
[
!
-f
$sidekiq_pid_path
]
||
{
[
"
$mail_room_enabled
"
=
true
]
&&
[
!
-f
$mail_room_pid_path
]
}
;
do
while
[
!
-f
$web_server_pid_path
]
||
[
!
-f
$sidekiq_pid_path
]
||
{
[
"
$mail_room_enabled
"
=
true
]
&&
[
!
-f
$mail_room_pid_path
]
;
}
;
do
sleep
0.1
;
i
=
$((
i+1
))
if
[
$((
i%10
))
=
0
]
;
then
...
...
@@ -128,7 +128,7 @@ check_status(){
mail_room_status
=
"-1"
fi
fi
if
[
$web_status
=
0
]
&&
[
$sidekiq_status
=
0
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
$mail_room_status
=
0
]
}
;
then
if
[
$web_status
=
0
]
&&
[
$sidekiq_status
=
0
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
$mail_room_status
=
0
]
;
}
;
then
gitlab_status
=
0
else
# http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
...
...
@@ -168,7 +168,7 @@ check_stale_pids(){
## If no parts of the service is running, bail out.
exit_if_not_running
(){
check_stale_pids
if
[
"
$web_status
"
!=
"0"
]
&&
[
"
$sidekiq_status
"
!=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
!=
"0"
]
}
;
then
if
[
"
$web_status
"
!=
"0"
]
&&
[
"
$sidekiq_status
"
!=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
!=
"0"
]
;
}
;
then
echo
"GitLab is not running."
exit
fi
...
...
@@ -179,13 +179,13 @@ start_gitlab() {
check_stale_pids
if
[
"
$web_status
"
!=
"0"
]
;
then
echo
-n
"Starting GitLab Unicorn"
echo
"Starting GitLab Unicorn"
fi
if
[
"
$sidekiq_status
"
!=
"0"
]
;
then
echo
-n
"Starting GitLab Sidekiq"
echo
"Starting GitLab Sidekiq"
fi
if
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
!=
"0"
]
;
then
echo
-n
"Starting GitLab MailRoom"
echo
"Starting GitLab MailRoom"
fi
# Then check if the service is running. If it is: don't start again.
...
...
@@ -225,13 +225,13 @@ stop_gitlab() {
exit_if_not_running
if
[
"
$web_status
"
=
"0"
]
;
then
echo
-n
"Shutting down GitLab Unicorn"
echo
"Shutting down GitLab Unicorn"
fi
if
[
"
$sidekiq_status
"
=
"0"
]
;
then
echo
-n
"Shutting down GitLab Sidekiq"
echo
"Shutting down GitLab Sidekiq"
fi
if
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
=
"0"
]
;
then
echo
-n
"Shutting down GitLab MailRoom"
echo
"Shutting down GitLab MailRoom"
fi
# If the Unicorn web server is running, tell it to stop;
...
...
@@ -248,11 +248,11 @@ stop_gitlab() {
fi
# If something needs to be stopped, lets wait for it to stop. Never use SIGKILL in a script.
while
[
"
$web_status
"
=
"0"
]
||
[
"
$sidekiq_status
"
=
"0"
]
||
{
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
=
"0"
]
}
;
do
while
[
"
$web_status
"
=
"0"
]
||
[
"
$sidekiq_status
"
=
"0"
]
||
{
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
=
"0"
]
;
}
;
do
sleep
1
check_status
printf
"."
if
[
"
$web_status
"
!=
"0"
]
&&
[
"
$sidekiq_status
"
!=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
!=
"0"
]
}
;
then
if
[
"
$web_status
"
!=
"0"
]
&&
[
"
$sidekiq_status
"
!=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
!=
"0"
]
;
}
;
then
printf
"
\n
"
break
fi
...
...
@@ -272,7 +272,7 @@ stop_gitlab() {
## Prints the status of GitLab and it's components.
print_status
()
{
check_status
if
[
"
$web_status
"
!=
"0"
]
&&
[
"
$sidekiq_status
"
!=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
!=
"0"
]
}
;
then
if
[
"
$web_status
"
!=
"0"
]
&&
[
"
$sidekiq_status
"
!=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
!=
"0"
]
;
}
;
then
echo
"GitLab is not running."
return
fi
...
...
@@ -292,8 +292,8 @@ print_status() {
else
printf
"The GitLab MailRoom email processor is
\0
33[31mnot running
\0
33[0m.
\n
"
fi
end
if
[
"
$web_status
"
=
"0"
]
&&
[
"
$sidekiq_status
"
=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
=
"0"
]
}
;
then
fi
if
[
"
$web_status
"
=
"0"
]
&&
[
"
$sidekiq_status
"
=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
=
"0"
]
;
}
;
then
printf
"GitLab and all its components are
\0
33[32mup and running
\0
33[0m.
\n
"
fi
}
...
...
@@ -324,7 +324,7 @@ reload_gitlab(){
## Restarts Sidekiq and Unicorn.
restart_gitlab
(){
check_status
if
[
"
$web_status
"
=
"0"
]
||
[
"
$sidekiq_status
"
=
"0"
]
||
{
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
=
"0"
]
}
;
then
if
[
"
$web_status
"
=
"0"
]
||
[
"
$sidekiq_status
"
=
"0"
]
||
{
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
=
"0"
]
;
}
;
then
stop_gitlab
fi
start_gitlab
...
...
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