CESNET/netopeer2

Question regarding spawning netopeer2-server in background

Closed this issue · 3 comments

Hi Michal,

we are trying to run netopeer2-server in a container, we are trying to run it with a script and the parent script exits

start netconf server

mountSchemaFile="/opt/bin/scripts/mount_schema.xml"
if [ "$lsyslog" == "true" ]
then
netopeer2-server -v 2 -t 15 -x $mountSchemaFile
else
netopeer2-server -d -v 2 -t 15 -x $mountSchemaFile &
fi
exit 0

In either of cases, we are seeing below issue, when we connect via netopeer2-cli
[root@srikanth-gnb-999-cucp-1-cm-agent-0 /]# netopeer2-cli

connect
nc ERROR: SSH channel unexpectedly closed.
nc ERROR: Failed to send the RPC.
nc ERROR: Invalid session to send RPCs.
nc ERROR: Invalid session, discarding.
nc ERROR: Invalid session to send RPCs.
nc ERROR: Failed to send the RPC.
nc ERROR: Invalid session, discarding.
cmd_connect: Connecting to the localhost:830 as user "root" failed.

but when we run same command in interactive shell ,
netopeer2-server -v 2 -t 15

netopeer2-cli connects without any issue,
how do we spawn netopeer2-server from a script that runs as preinit and exits.

Thanks,
Srikanth

This is S6 Overlay infra we are using for containers.

That is not known to me and I cannot help you with this. The server behaves as one would expect, using -d it runs as a normal application, without it it runs as a daemon. Anything else is up to you to figure out and is not specific to netopeer2-server.

Problem was with file not found on mount schema xml file, Thanks for help Michal