Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bcsbridge
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
cs
cli
bcsbridge
Commits
bbf7ec68
Commit
bbf7ec68
authored
2 years ago
by
Claudio Scafuri
Browse files
Options
Downloads
Patches
Plain Diff
removed - old
parent
8fa024f0
No related branches found
No related tags found
1 merge request
!5
Port log from config
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
TCPSserver/prova.sh
+0
-9
0 additions, 9 deletions
TCPSserver/prova.sh
TCPSserver/tcps.sh
+0
-156
0 additions, 156 deletions
TCPSserver/tcps.sh
with
0 additions
and
165 deletions
TCPSserver/prova.sh
deleted
100755 → 0
+
0
−
9
View file @
8fa024f0
INSTANCES
=
"elettrabcsbridge012.cfg elettrabcsbridge022.cfg elettrabcsbridge032.cfg elettrabcsbridge042.cfg elettrabcsbridge052.cfg elettrabcsbridge062.cfg elettrabcsbridge072.cfg elettrabcsbridge082.cfg elettrabcsbridge092.cfg elettrabcsbridge102.cfg"
PORTS
=(
20012 20022 20032 20042 20052 20062 02072 20082 20092 20102
)
index
=
0
for
inst
in
$INSTANCES
do
PORT
=
${
PORTS
[
$index
]
}
echo
"
$inst
-f
$PORT
"
index
=
$((
index
+
1
))
done
\ No newline at end of file
This diff is collapsed.
Click to expand it.
TCPSserver/tcps.sh
deleted
100755 → 0
+
0
−
156
View file @
8fa024f0
#!/bin/bash
################################################################################
# RP - 17 febbraio 2006
# CS - 23 gennaio 2009
# Codici di errore dello script
# - in avvio:
# 2: non c'e` l'eseguibile oppure i permessi non sono impostati correttamente
# 3: il programma e` gia` in esecuzione
# 4: non c'e` il file di configurazione /etc/default/elettra_daemons
# 5: nel file di configurazione /etc/default/elettra_daemons non viene
# richiesto di avviare il programma
# 6: errore nell'avvio del programma come root.
# 7: errore nell'avvio del programma come controls.
# 8: e` stato utilizzato un utente sbagliato per eseguire lo script
# - in arresto:
# 50: il programma non e` in esecuzione
# 51: si e` verificato un errore arrestando il programma. Viene fornito il
# codice di uscita del kill
################################################################################
PREFIX
=
"/runtime/elettra/servers"
CONFPREFIX
=
"
$PREFIX
/etc"
PATH
=
/sbin:/bin:/usr/sbin:/usr/bin:
$PREFIX
/bin
#LD_LIBRARY_PATH=/usr/local/tango-7.2.6/lib:/usr/local/omniorb-4.1.4/lib
export
LD_LIBRARY_PATH PATH
export
TANGO_HOST
=
tom:20000
PYTHONPATH
=
$PREFIX
/bin
export
PYTHONPATH
SERVER
=
"
$PREFIX
/bin/TCPStwserver.py"
INSTANCES
=
"elettrabcsbridge012.cfg elettrabcsbridge022.cfg elettrabcsbridge032.cfg elettrabcsbridge042.cfg elettrabcsbridge052.cfg elettrabcsbridge062.cfg elettrabcsbridge072.cfg elettrabcsbridge082.cfg elettrabcsbridge092.cfg elettrabcsbridge102.cfg elettrabcsbridge011.cfg elettrabcsbridge061.cfg elettrabcsbridge071.cfg elettrabcsbridge081.cfg elettrabcsbridge101.cfg elettrabcsbridge111.cfg elettrabcsbridge091.cfg elettrabcsbridge112.cfg elettrabcsbridge.cfg"
PORTS
=(
20012 20022 20032 20042 20052 20062 20072 20082 20092 20102 20011 20061 20071 20081 20101 20111 20091 20112 20000
)
LOGNAME
=
"tcpserver"
LOGBASE
=
"/runtime/site/ecsproxy/log"
LOGSIZE
=
1024k
LOGLEVEL
=
info
startserver
()
{
if
[
!
-x
$SERVER
]
;
then
echo
" FAILED:
$SERVER
executable not found."
exit
2
fi
index
=
0
for
INSTANCE
in
$INSTANCES
do
PORT
=
${
PORTS
[
$index
]
}
LOGFILE
=
"
$LOGBASE
/
$LOGNAME$PORT
.log"
if
[
`
ps
-ef
|
grep
"
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
"
|
grep
-v
grep
|
wc
-l
`
-eq
"1"
]
then
echo
"
$SERVER
-f
$INSTANCE
: already running."
else
echo
-n
"Starting
$SERVER
$INSTANCE
server ..."
if
[
`
id
-u
`
-eq
"0"
]
then
su - controls
-c
"cd / && ulimit -c unlimited &&
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
-p
$PORT
-v
$LOGLEVEL
-l
$LOGFILE
&"
sleep
1
if
[
`
ps
-ef
|
grep
"
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
"
|
grep
-v
grep
|
wc
-l
`
-eq
"0"
]
then
echo
" FAILED: an error occurred starting the program. Exit code:
$?
"
exit
6
else
echo
" OK."
fi
else
if
[
`
id
-u
`
-eq
"10005"
]
then
cd
/
&&
ulimit
-c
unlimited
&&
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
-p
$PORT
-v
$LOGLEVEL
-l
$LOGFILE
&
sleep
1
if
[
`
ps
-ef
|
grep
"
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
"
|
grep
-v
grep
|
wc
-l
`
-eq
"0"
]
then
echo
" FAILED: an error occurred starting the program. Exit code:
$?
"
exit
6
else
echo
" OK."
fi
else
echo
" FAILED: You must be root or controls to run this script."
exit
8
fi
fi
fi
index
=
$((
index
+
1
))
done
}
stopserver
()
{
for
INST
in
$INSTANCES
do
PORT
=
${
PORTS
[
$index
]
}
LOGFILE
=
"
$LOGBASE
/
$LOGFILE$PORT
.log"
INSTANCE
=
$INST
echo
-n
"Stopping
$SERVER
$CONFPREFIX
/
$INSTANCE
server ..."
if
[
`
ps
-ef
|
grep
"
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
"
|
grep
-v
grep
|
wc
-l
`
-eq
"0"
]
then
echo
" FAILED: not running."
else
kill
`
ps
-ef
|
grep
"
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
"
|
grep
-v
grep
|
awk
'{print $2}'
`
if
[
$?
!=
"0"
]
then
echo
" FAILED stopping
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
: an error occurred stopping the program. Exit code:
$?
"
else
echo
" OK."
fi
fi
done
}
status
()
{
for
INSTANCE
in
$INSTANCES
do
echo
-n
"checking
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
..."
if
[
`
ps
-ef
|
grep
"
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
"
|
grep
-v
grep
|
wc
-l
`
-eq
"0"
]
then
echo
" NOT running."
fi
if
[
`
ps
-ef
|
grep
"
$SERVER
-f
$CONFPREFIX
/
$INSTANCE
"
|
grep
-v
grep
|
wc
-l
`
-gt
"0"
]
then
echo
" running."
fi
done
}
case
"
$1
"
in
start
)
startserver
;;
stop
)
stopserver
;;
status
)
status
;;
restart
)
$0
stop
sleep
2
$0
start
;;
*
)
echo
"Usage: /etc/init.d/
$0
{start|stop|status|restart}"
;;
esac
exit
0
# EOF
This diff is collapsed.
Click to expand it.
Preview
0%
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