Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
3d4fc884
Commit
3d4fc884
authored
11 years ago
by
brinn
Browse files
Options
Downloads
Patches
Plain Diff
[BIS-300] Make db connection logging available in command line script datastore_server.sh.
SVN: 29600
parent
252f2ee0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
datastore_server/dist/datastore_server.sh
+90
-5
90 additions, 5 deletions
datastore_server/dist/datastore_server.sh
with
90 additions
and
5 deletions
datastore_server/dist/datastore_server.sh
+
90
−
5
View file @
3d4fc884
...
...
@@ -93,7 +93,7 @@ printStatus()
PID
=
`
cat
$PIDFILE
`
isPIDRunning
$PID
if
[
$?
-eq
0
]
;
then
echo
"Data Store Server is running (pid
$PID
)"
echo
"Data Store Server is running (pid
$PID
)"
return
0
else
echo
"Data Store Server is dead (stale pid
$PID
)"
...
...
@@ -142,8 +142,10 @@ fi
command
=
$1
# Create lib symlinks before building the classpath
./autosymlink.sh
if
[
"
$command
"
==
"start"
]
;
then
# Create lib symlinks before building the classpath
./autosymlink.sh
fi
# Build classpath from $LIB_FOLDER and $EXT_LIB_FOLDER content. First JAR is datastore_server.jar because it has to appear before cifex.jar
CP
=
`
echo
$LIB_FOLDER
/datastore_server.jar
$LIB_FOLDER
/
*
.jar
$EXT_LIB_FOLDER
/
*
.jar |
sed
's/ /:/g'
`
...
...
@@ -253,7 +255,17 @@ case "$command" in
$SCRIPT
start
;;
help
)
${
CMD
}
--help
echo
"Usage:
$0
{start|stop|restart|status|help|version}"
echo
"Advanced:"
echo
"
$0
show-shredder - show the list of files / directories that wait to be shreddered"
echo
"
$0
show-updater-queue - show the queue of datasets that await updating their archiving status in openBIS AS"
echo
"
$0
show-command-queue - show the queue of commands from openBIS AS waiting to be executed"
echo
"
$0
log-db-connections - log the currently active database connections to log/startup_log.txt"
echo
"
$0
log-thread-dump - log the current thread dump to log/startup_log.txt"
echo
"
$0
debug-db-connections - switch on database connection debug logging"
echo
"
$0
no-debug-db-connections - switch off database connection debug logging"
echo
"
$0
record-stacktrace-db-connections - switch on database connection stacktrace recording"
echo
"
$0
no-record-stacktrace-db-connections - switch off database connection stacktrace recording"
;;
version
)
${
CMD
}
--version
...
...
@@ -267,8 +279,81 @@ case "$command" in
show-command-queue
)
${
CMD
}
--show-command-queue
;;
log-thread-dump
)
if
[
-f
$PIDFILE
]
;
then
PID
=
`
cat
$PIDFILE
2> /dev/null
`
isPIDRunning
$PID
if
[
$?
-eq
0
]
;
then
kill
-3
$PID
echo
"Thread dump logged to log/startup_log.txt"
else
echo
"Error: Data Store Server not running."
exit
100
fi
else
echo
"Error: Data Store Server not running."
exit
100
fi
;;
log-db-connections
)
getStatus
EXIT_STATUS
=
$?
if
[
$EXIT_STATUS
-ne
0
]
;
then
echo
"Error: Data Store Server not running."
exit
100
fi
mkdir
-p
.control
if
[
"
$1
"
!=
""
]
;
then
touch
.control/db-connections-print-active.
$1
else
touch
.control/db-connections-print-active
fi
echo
"Active database connections logged to log/startup_log.txt"
;;
debug-db-connections
)
getStatus
EXIT_STATUS
=
$?
if
[
$EXIT_STATUS
-ne
0
]
;
then
echo
"Error: Data Store Server not running."
exit
100
fi
mkdir
-p
.control
touch
.control/db-connections-debug-on
echo
"Switched on debug logging for database connections."
;;
no-debug-db-connections
)
getStatus
EXIT_STATUS
=
$?
if
[
$EXIT_STATUS
-ne
0
]
;
then
echo
"Error: Data Store Server not running."
exit
100
fi
mkdir
-p
.control
touch
.control/db-connections-debug-off
echo
"Switched off debug logging for database connections."
;;
record-stacktrace-db-connections
)
getStatus
EXIT_STATUS
=
$?
if
[
$EXIT_STATUS
-ne
0
]
;
then
echo
"Error: Data Store Server not running."
exit
100
fi
mkdir
-p
.control
touch
.control/db-connections-stacktrace-on
;;
no-record-stacktrace-db-connections
)
getStatus
EXIT_STATUS
=
$?
if
[
$EXIT_STATUS
-ne
0
]
;
then
echo
"Error: Data Store Server not running."
exit
100
fi
mkdir
-p
.control
touch
.control/db-connections-stacktrace-off
;;
*
)
echo
$
"Usage:
$0
{start|stop|restart|status|help|version
|show-shredder|show-updater-queue|show-command-queue
}"
echo
"Usage:
$0
{start|stop|restart|status|help|version}"
exit
200
;;
esac
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment