I have a containerized unimrcp server and it is running as kubernetes pod. When I go inside container and do ps -ef
its output is like this:
[root@unimrcp-0 fd]# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 99 13:13 ? 01:07:38 ./unimrcpserver
root 75 1 0 13:13 ? 00:00:00 [arping] <defunct>
root 76 1 0 13:13 ? 00:00:00 [arping] <defunct>
root 154 0 0 13:14 pts/0 00:00:00 /bin/bash
root 209 154 0 14:21 pts/0 00:00:00 ps -ef
Also if I do cat /proc/[pid]/fd/1
then I am seeing some corrupted output like this:
unknown command: ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Why there is no controlling terminal attached with the process. I have disabled the Unimrcp from logging to stdout. Also the CPU utilization is 99%. Can someone please help to solve this?
This is the entrypoint of the container
#!/bin/sh
source /ip-conf.sh; set_control_media_network "UNIMRCP"
CONTROL_IP=$(get_control_ipv4)
MEDIA_IP=$(get_media_ipv4)
LOG_LEVEL=$(echo $LOG_LEVEL | tr -s " " | xargs)
LOG_OUTPUT=$(echo $LOG_OUTPUT | tr -s " " | xargs)
LOG_HEADERS=$(echo $LOG_HEADERS | tr -s " " | xargs)
sed -i 's+<priority>.*</priority>+''<priority>'$LOG_LEVEL'</priority>+g'
/usr/local/unimrcp/conf/logger.xml
sed -i 's+<output>.*</output>+''<output>'$LOG_OUTPUT'</output>+g'
/usr/local/unimrcp/conf/logger.xml
sed -i 's+<headers>.*</headers>+''<headers>'$LOG_HEADERS'</headers>+g'
/usr/local/unimrcp/conf/logger.xml
sed -i 's+<!-- <ip>.*</ip> -->+''<ip>'$CONTROL_IP'</ip>+g'
/usr/local/unimrcp/conf/unimrcpserver.xml
sed -i 's+<!-- <rtp-ip>.*</rtp-ip> -->+''<rtp-ip>'$MEDIA_IP'</rtp-ip>+g'
/usr/local/unimrcp/conf/unimrcpserver.xml
cd /usr/local/unimrcp/bin/
exec ./unimrcpserver
This is the output of the ls -l at the /proc/1/fd/ inside the unimrcp container
total 0
lrwx------ 1 root root 64 Jan 2 12:04 0 -> /dev/null
l-wx------ 1 root root 64 Jan 2 12:04 1 -> pipe:[17601930]
l-wx------ 1 root root 64 Jan 2 12:04 10 -> pipe:[17605635]
lrwx------ 1 root root 64 Jan 2 12:04 11 -> socket:[17605636]
lrwx------ 1 root root 64 Jan 2 12:04 12 -> anon_inode:[eventpoll]
lrwx------ 1 root root 64 Jan 2 12:04 13 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Jan 2 12:04 14 -> anon_inode:[eventpoll]
lrwx------ 1 root root 64 Jan 2 12:04 15 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Jan 2 12:04 16 -> anon_inode:[eventpoll]
lrwx------ 1 root root 64 Jan 2 12:04 17 -> socket:[17602110]
lrwx------ 1 root root 64 Jan 2 12:04 18 -> socket:[17602111]
lrwx------ 1 root root 64 Jan 2 12:04 19 -> anon_inode:[eventpoll]
l-wx------ 1 root root 64 Jan 2 12:04 2 -> pipe:[17601931]
lrwx------ 1 root root 64 Jan 2 12:04 20 -> socket:[17603083]
lrwx------ 1 root root 64 Jan 2 12:04 21 -> socket:[17603084]
lr-x------ 1 root root 64 Jan 2 12:04 22 -> /dev/urandom
lrwx------ 1 root root 64 Jan 2 12:04 23 -> socket:[17603087]
lrwx------ 1 root root 64 Jan 2 12:04 24 -> socket:[17603088]
l-wx------ 1 root root 64 Jan 2 12:04 3 ->
/usr/local/unimrcp/log/unimrcpserver_2020.01.02_12.04.08.988860.log
lrwx------ 1 root root 64 Jan 2 12:04 4 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Jan 2 12:04 5 -> pipe:[17605633]
l-wx------ 1 root root 64 Jan 2 12:04 6 -> pipe:[17605633]
lrwx------ 1 root root 64 Jan 2 12:04 7 -> socket:[17605634]
lrwx------ 1 root root 64 Jan 2 12:04 8 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Jan 2 12:04 9 -> pipe:[17605635]
sed
to your configuration file looks OK. – Kusalananda Jan 02 '20 at 11:57