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
Boxiang Sun
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
Show 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(){
...
@@ -85,7 +85,7 @@ check_pids(){
wait_for_pids
(){
wait_for_pids
(){
# We are sleeping a bit here mostly because sidekiq is slow at writing it's pid
# We are sleeping a bit here mostly because sidekiq is slow at writing it's pid
i
=
0
;
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
;
sleep
0.1
;
i
=
$((
i+1
))
i
=
$((
i+1
))
if
[
$((
i%10
))
=
0
]
;
then
if
[
$((
i%10
))
=
0
]
;
then
...
@@ -128,7 +128,7 @@ check_status(){
...
@@ -128,7 +128,7 @@ check_status(){
mail_room_status
=
"-1"
mail_room_status
=
"-1"
fi
fi
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
gitlab_status
=
0
else
else
# http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
# http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
...
@@ -168,7 +168,7 @@ check_stale_pids(){
...
@@ -168,7 +168,7 @@ check_stale_pids(){
## If no parts of the service is running, bail out.
## If no parts of the service is running, bail out.
exit_if_not_running
(){
exit_if_not_running
(){
check_stale_pids
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."
echo
"GitLab is not running."
exit
exit
fi
fi
...
@@ -179,13 +179,13 @@ start_gitlab() {
...
@@ -179,13 +179,13 @@ start_gitlab() {
check_stale_pids
check_stale_pids
if
[
"
$web_status
"
!=
"0"
]
;
then
if
[
"
$web_status
"
!=
"0"
]
;
then
echo
-n
"Starting GitLab Unicorn"
echo
"Starting GitLab Unicorn"
fi
fi
if
[
"
$sidekiq_status
"
!=
"0"
]
;
then
if
[
"
$sidekiq_status
"
!=
"0"
]
;
then
echo
-n
"Starting GitLab Sidekiq"
echo
"Starting GitLab Sidekiq"
fi
fi
if
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
!=
"0"
]
;
then
if
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
!=
"0"
]
;
then
echo
-n
"Starting GitLab MailRoom"
echo
"Starting GitLab MailRoom"
fi
fi
# Then check if the service is running. If it is: don't start again.
# Then check if the service is running. If it is: don't start again.
...
@@ -225,13 +225,13 @@ stop_gitlab() {
...
@@ -225,13 +225,13 @@ stop_gitlab() {
exit_if_not_running
exit_if_not_running
if
[
"
$web_status
"
=
"0"
]
;
then
if
[
"
$web_status
"
=
"0"
]
;
then
echo
-n
"Shutting down GitLab Unicorn"
echo
"Shutting down GitLab Unicorn"
fi
fi
if
[
"
$sidekiq_status
"
=
"0"
]
;
then
if
[
"
$sidekiq_status
"
=
"0"
]
;
then
echo
-n
"Shutting down GitLab Sidekiq"
echo
"Shutting down GitLab Sidekiq"
fi
fi
if
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
=
"0"
]
;
then
if
[
"
$mail_room_enabled
"
=
true
]
&&
[
"
$mail_room_status
"
=
"0"
]
;
then
echo
-n
"Shutting down GitLab MailRoom"
echo
"Shutting down GitLab MailRoom"
fi
fi
# If the Unicorn web server is running, tell it to stop;
# If the Unicorn web server is running, tell it to stop;
...
@@ -248,11 +248,11 @@ stop_gitlab() {
...
@@ -248,11 +248,11 @@ stop_gitlab() {
fi
fi
# If something needs to be stopped, lets wait for it to stop. Never use SIGKILL in a script.
# 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
sleep
1
check_status
check_status
printf
"."
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
"
printf
"
\n
"
break
break
fi
fi
...
@@ -272,7 +272,7 @@ stop_gitlab() {
...
@@ -272,7 +272,7 @@ stop_gitlab() {
## Prints the status of GitLab and it's components.
## Prints the status of GitLab and it's components.
print_status
()
{
print_status
()
{
check_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."
echo
"GitLab is not running."
return
return
fi
fi
...
@@ -292,8 +292,8 @@ print_status() {
...
@@ -292,8 +292,8 @@ print_status() {
else
else
printf
"The GitLab MailRoom email processor is
\0
33[31mnot running
\0
33[0m.
\n
"
printf
"The GitLab MailRoom email processor is
\0
33[31mnot running
\0
33[0m.
\n
"
fi
fi
end
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
printf
"GitLab and all its components are
\0
33[32mup and running
\0
33[0m.
\n
"
printf
"GitLab and all its components are
\0
33[32mup and running
\0
33[0m.
\n
"
fi
fi
}
}
...
@@ -324,7 +324,7 @@ reload_gitlab(){
...
@@ -324,7 +324,7 @@ reload_gitlab(){
## Restarts Sidekiq and Unicorn.
## Restarts Sidekiq and Unicorn.
restart_gitlab
(){
restart_gitlab
(){
check_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
stop_gitlab
stop_gitlab
fi
fi
start_gitlab
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