Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
da32b0f0
Commit
da32b0f0
authored
Dec 15, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Catch all errors while starting testserver
parent
2c171b48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
gargantext-testserver
tools/init.d/gargantext-testserver
+19
-4
No files found.
tools/init.d/gargantext-testserver
View file @
da32b0f0
...
...
@@ -22,7 +22,7 @@ BASH=/bin/bash
CELERY_INIT
=
$(
dirname
$0
)
/gargantext-celery
GARGANTEXT_CONF
=
$(
realpath
${
GARGANTEXT_CONF
:-
gargantext
.ini
})
DAEMON_OPTS
=
"
$PWD
/manage.py runserver"
DAEMON_OPTS
=
"
-u
$PWD
/manage.py runserver"
test
-x
"
$DAEMON
"
||
exit
0
...
...
@@ -51,11 +51,26 @@ start() {
# 1 if daemon was already running
# 2 if daemon could not be started
ERROR_LOG
=
$(
mktemp
)
CMD
=
"exec
$DAEMON
$DAEMON_OPTS
>
$ERROR_LOG
2>&1"
# Already running?
start-stop-daemon
--start
--pidfile
$PID
--exec
$DAEMON
--test
>
/dev/null
\
||
return
1
ERROR_LOG
=
$(
mktemp
)
CMD
=
"exec
$DAEMON
$DAEMON_OPTS
2>
$ERROR_LOG
1> /dev/null"
# Voodoo to disable stderr temporarily
exec
7>&2 2>/dev/null
# Check for errors at initialization that couldn't be catched otherwise
$DAEMON
$DAEMON_OPTS
--noreload
2>
$ERROR_LOG
1> /dev/null &
# Wait 2 second and kill process, if it was already exited we have an error
if
sleep
2
&&
!
kill
$!
&> /dev/null
;
then
log_progress_msg
"[
$(
tail
-1
$ERROR_LOG
)
]"
return
2
fi
# Voodoo to restore stderr
sleep
0.1
&&
exec
2>&7
# Start the daemon
start-stop-daemon
--start
--pidfile
$PID
--make-pidfile
--background
--startas
$BASH
--chdir
"
$PWD
"
--
-c
"
$CMD
"
\
||
return
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