Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
9df9a176
Commit
9df9a176
authored
8 years ago
by
Arno Schoenmakers
Browse files
Options
Downloads
Patches
Plain Diff
TAsk #10196: OTB script for centos7
parent
1f12080c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/OTB/OTB/dist-src/OTB
+5
-20
5 additions, 20 deletions
SAS/OTB/OTB/dist-src/OTB
with
5 additions
and
20 deletions
SAS/OTB/OTB/dist-src/OTB
+
5
−
20
View file @
9df9a176
#!/bin/bash
#!/bin/bash
#
# Script to start, stop, restart and ask status of the OTB server and client
#
# Run as user lofarsys or user tomcat on any host that runs the OTB (sas001/sas099)
#
adapter_logdir
=
/opt/tomcat/mom-otdb-adapter/logs
otdb_conf_file
=
/opt/tomcat/mom-otdb-adapter/conf/config-otdb.xml
syntaxerror
()
{
echo
"Usage: OTB [start|stop|status|serverstart|serverstop|serverstatus] [port]"
...
...
@@ -45,7 +42,7 @@ fi
echo
"Using port
$port1
for this client"
export
OTB_DIR
=
/opt/otdb/otb/client
export
JAVA_HOME
=
/usr/
java/jdk
1.7.0
_02
export
JAVA_HOME
=
/usr/
lib/jvm/jre-
1.7.0
echo
echo
---
Starting OTB Client
---
...
...
@@ -66,7 +63,7 @@ curdate=`date +%Y%m%dT%H%M%S`
logfile
=
"/localhome/log/OTBClient_
${
port1
}
_
${
curdate
}
.log"
echo
"Logging client logs to file
$logfile
"
$JAVA_HOME
/bin/java
-cp
$CLASSPATH
nl.astron.lofar.sas.otb.Main
-s
sas001
-p
$port1
-d
LOFAR_4
-u
busyman 2>&1 1>
$logfile
&
$JAVA_HOME
/bin/java
-cp
$CLASSPATH
nl.astron.lofar.sas.otb.Main
-s
`
hostname
`
-p
$port1
-d
LOFAR_4
-u
busyman 2>&1 1>
$logfile
&
clientpid
=
$!
echo
Started OTB client with PID:
$clientpid
...
...
@@ -129,12 +126,6 @@ for user_port in "${user_ports[@]}"
serverstart
()
{
# OTB Servers are always running as user tomcat
if
[
"
$USER
"
!=
"tomcat"
]
;
then
sudo
-u
tomcat /opt/otdb/OTB serverstart
$*
exit
fi
# Check if portnumber is added to commandline; if yes, use it.
if
[
-z
$1
]
;
then
port1
=
12500
...
...
@@ -146,7 +137,7 @@ fi
echo
"Using port
$port1
and
$port2
for this server"
export
OTB_DIR
=
/opt/otdb/otb/server
export
JAVA_HOME
=
/usr/
java/jdk
1.7.0
_02
export
JAVA_HOME
=
/usr/
lib/jvm/jre-
1.7.0
echo
echo
---
Starting OTB Server
---
...
...
@@ -170,7 +161,7 @@ echo "Logging serverlogs to file $logfile"
serverpid
=
0
ps
-ef
|
grep
-v
grep
|
grep
java |
grep
server |
grep
$port1
2>&1 1>/dev/null
if
[
$?
-ne
0
]
;
then
$JAVA_HOME
/bin/java
-cp
$CLASSPATH
nl.astron.lofar.sas.otb.jotdb3.jOTDBserver
-s
sas001
-d
sasdb
-p
$port1
-o
$port2
2>&1 1>&
$logfile
&
$JAVA_HOME
/bin/java
-cp
$CLASSPATH
nl.astron.lofar.sas.otb.jotdb3.jOTDBserver
-s
`
hostname
`
-d
sasdb
-p
$port1
-o
$port2
2>&1 1>&
$logfile
&
serverpid
=
$!
echo
Started server with PID:
$serverpid
else
...
...
@@ -181,12 +172,6 @@ fi
serverstop
()
{
# OTB Servers are always running as user tomcat
if
[
"
$USER
"
!=
"tomcat"
]
;
then
sudo
-u
tomcat /opt/otdb/OTB serverstop
$*
exit
fi
if
[
-z
$1
]
;
then
port
=
12500
else
...
...
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