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
Jérome Perrin
gitlab-ce
Commits
4353babe
Commit
4353babe
authored
May 08, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3893 from rezigned/feature/update-init.d
Update init.d script
parents
25d5c1f6
76d958eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
lib/support/init.d/gitlab
lib/support/init.d/gitlab
+10
-5
No files found.
lib/support/init.d/gitlab
View file @
4353babe
...
...
@@ -16,6 +16,7 @@
APP_ROOT
=
"/home/git/gitlab"
APP_USER
=
"git"
DAEMON_OPTS
=
"-C
$APP_ROOT
/config/puma.rb -e production"
PID_PATH
=
"
$APP_ROOT
/tmp/pids"
WEB_SERVER_PID
=
"
$PID_PATH
/puma.pid"
...
...
@@ -36,6 +37,10 @@ check_pid(){
fi
}
execute
()
{
sudo
-u
$APP_USER
-H
bash
-l
-c
"
$1
"
}
start
()
{
cd
$APP_ROOT
check_pid
...
...
@@ -45,8 +50,8 @@ start() {
exit
1
else
if
[
`
whoami
`
=
root
]
;
then
sudo
-u
git
-H
bash
-l
-c
"RAILS_ENV=production bundle exec puma
$DAEMON_OPTS
"
sudo
-u
git
-H
bash
-l
-c
"mkdir -p
$PID_PATH
&&
$START_SIDEKIQ
> /dev/null 2>&1 &"
execute
"RAILS_ENV=production bundle exec puma
$DAEMON_OPTS
"
execute
"mkdir -p
$PID_PATH
&&
$START_SIDEKIQ
> /dev/null 2>&1 &"
echo
"
$DESC
started"
fi
fi
...
...
@@ -58,7 +63,7 @@ stop() {
if
[
"
$PID
"
-ne
0
-a
"
$STATUS
"
-ne
0
]
;
then
## Program is running, stop it.
kill
-QUIT
`
cat
$WEB_SERVER_PID
`
sudo
-u
git
-H
bash
-l
-c
"mkdir -p
$PID_PATH
&&
$STOP_SIDEKIQ
> /dev/null 2>&1 &"
execute
"mkdir -p
$PID_PATH
&&
$STOP_SIDEKIQ
> /dev/null 2>&1 &"
rm
"
$WEB_SERVER_PID
"
>>
/dev/null
echo
"
$DESC
stopped"
else
...
...
@@ -74,9 +79,9 @@ restart() {
if
[
"
$PID
"
-ne
0
-a
"
$STATUS
"
-ne
0
]
;
then
echo
"Restarting
$DESC
..."
kill
-USR2
`
cat
$WEB_SERVER_PID
`
sudo
-u
git
-H
bash
-l
-c
"mkdir -p
$PID_PATH
&&
$STOP_SIDEKIQ
> /dev/null 2>&1 &"
execute
"mkdir -p
$PID_PATH
&&
$STOP_SIDEKIQ
> /dev/null 2>&1 &"
if
[
`
whoami
`
=
root
]
;
then
sudo
-u
git
-H
bash
-l
-c
"mkdir -p
$PID_PATH
&&
$START_SIDEKIQ
> /dev/null 2>&1 &"
execute
"mkdir -p
$PID_PATH
&&
$START_SIDEKIQ
> /dev/null 2>&1 &"
fi
echo
"
$DESC
restarted."
else
...
...
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