Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta-dcache-frontend
Commits
d49bef94
Commit
d49bef94
authored
Oct 28, 2021
by
Tigran Mkrtchyan
☕
Browse files
cta-dcache: add command like options to specify port and logging
parent
237cb3b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
gRPC/FrontendGRpcSvc.cpp
View file @
d49bef94
...
...
@@ -17,6 +17,7 @@
*/
#include
"FrontendGRpcSvc.h"
#include
"version.h"
#include
<getopt.h>
static
const
std
::
string
CTA_DCACHE_VERSION
=
"cta-dcache-"
+
std
::
string
(
DCACHE_INTERFACE_VERSION
);
...
...
@@ -166,9 +167,43 @@ CtaRpcImpl::CtaRpcImpl(cta::log::LogContext *lc, std::unique_ptr<cta::catalogue:
using
namespace
cta
;
using
namespace
cta
::
common
;
static
struct
option
long_options
[]
=
{
{
"port"
,
required_argument
,
0
,
'p'
},
{
"log-header"
,
no_argument
,
0
,
'n'
},
{
"no-log-header"
,
no_argument
,
0
,
's'
},
{
0
,
0
,
0
,
0
}
};
int
main
(
const
int
argc
,
char
*
const
*
const
argv
)
{
std
::
unique_ptr
<
cta
::
log
::
Logger
>
logger
=
std
::
unique_ptr
<
cta
::
log
::
Logger
>
(
new
log
::
StdoutLogger
(
"cta-dev"
,
"cta-grpc-frontend"
,
true
));
std
::
string
port
=
"17017"
;
char
c
;
bool
shortHeader
=
true
;
int
option_index
=
0
;
const
std
::
string
shortHostName
=
utils
::
getShortHostname
();
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"p:ns"
,
long_options
,
&
option_index
))
!=
EOF
)
{
switch
(
c
)
{
case
'p'
:
port
=
std
::
string
(
optarg
);
break
;
case
'n'
:
shortHeader
=
true
;
break
;
case
's'
:
shortHeader
=
false
;
break
;
default:
exit
(
1
);
}
}
std
::
unique_ptr
<
cta
::
log
::
Logger
>
logger
=
std
::
unique_ptr
<
cta
::
log
::
Logger
>
(
new
log
::
StdoutLogger
(
shortHostName
,
"cta-dcache"
,
shortHeader
));
log
::
LogContext
lc
(
*
logger
);
lc
.
log
(
log
::
INFO
,
"Starting "
+
CTA_DCACHE_VERSION
);
...
...
@@ -176,7 +211,7 @@ int main(const int argc, char *const *const argv) {
// use castor config to avoid dependency on xroot-ssi
Configuration
config
(
"/etc/cta/cta.conf"
);
std
::
string
server_address
(
"0.0.0.0:
17017"
);
std
::
string
server_address
(
"0.0.0.0:
"
+
port
);
// Initialise the Catalogue
std
::
string
catalogueConfigFile
=
"/etc/cta/cta-catalogue.conf"
;
...
...
Write
Preview
Supports
Markdown
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