Hello guys,
I tried that and it _seems_ to be working, BUT:
running `service kamailio start` just stays there and fails after about a minute:
Job for kamailio.service failed. See 'systemctl status kamailio.service' and 'journalctl -xn' for details.
running systemctl status kamailio.service replies with:
# systemctl status kamailio.service
● kamailio.service - Kamailio SIP Server
Loaded: loaded (/etc/systemd/system/kamailio.service; enabled)
Active: activating (start) since Fri 2019-11-29 07:17:19 EST; 24s ago
Docs: man:kamailio(8)
http://www.kamailio.org/
Process: 24259 ExecStart=/usr/sbin/kamailio -m $SHM_SIZE -M $PKG_SIZE -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg (code=exited, status=0/SUCCESS)
Process: 24255 ExecStartPre=/usr/sbin/kamailio -c (code=exited, status=0/SUCCESS)
CGroup: /system.slice/kamailio.service
├─24261 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24263 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24264 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24265 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24266 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24267 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24268 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24269 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24270 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24271 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24272 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24273 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24274 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24275 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24276 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24277 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24278 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24279 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24280 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24281 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24282 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24283 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24284 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24285 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24286 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24287 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24288 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24289 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24290 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24291 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24292 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24293 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24294 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24295 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24296 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24297 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24298 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24299 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24300 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24301 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24302 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24303 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24304 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24305 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
├─24306 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
└─24307 /usr/sbin/kamailio -m 1024 -M 256 -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
Nov 29 07:17:43 sip /usr/sbin/kamailio[24306]: INFO: {1 CiUgnANofuHynAGcc5UfMA..} <script>: [RELAY] callid: CiUgnANofuHynAGcc5UfMA.. from=..... to=+.....
Nov 29 07:17:43 sip /usr/sbin/kamailio[24272]: ERROR: {1 cjwc3ajUEhE_QKuxT4FXOA..} <script>: route[WITHINGLG]: callid: cjwc3ajUEhE_QKuxT4FXOA.. Got a BYE message from .....
Nov 29 07:17:43 sip /usr/sbin/kamailio[24272]: INFO: {1 cjwc3ajUEhE_QKuxT4FXOA..} <script>: route[RELAY]: callid: cjwc3ajUEhE_QKuxT4FXOA.. Relaying
Nov 29 07:17:43 sip /usr/sbin/kamailio[24272]: INFO: {1 cjwc3ajUEhE_QKuxT4FXOA..} <script>: [RELAY] callid: cjwc3ajUEhE_QKuxT4FXOA.. from=..... to=..... is a GSM user (0)
Nov 29 07:17:44 sip /usr/sbin/kamailio[24300]: ERROR: <core> [core/tcp_read.c:302]: tcp_read_data(): error reading: Connection reset by peer (104) ([1.2.3.4]:11618 ->
Nov 29 07:17:44 sip /usr/sbin/kamailio[24300]: ERROR: <core> [core/tcp_read.c:304]: tcp_read_data(): -> [4.3.2.1]:5060)
Nov 29 07:17:44 sip /usr/sbin/kamailio[24300]: ERROR: <core> [core/tcp_read.c:1505]: tcp_read_req(): ERROR: tcp_read_req: error reading - c: 0x7f3c3fd9cb98 r: 0x7f3c3fd9cc18 (-1)
Nov 29 07:17:44 sip /usr/sbin/kamailio[24266]: NOTICE: {2 9FRQDB7DQM4GLP6UkgPcag..} acc [acc.c:281]: acc_log_request(): ACC: transaction answered: timestamp=1575029864;method=INVITE;from_tag=98337e3a;to_tag=as142a8bb8;call_id=9FRQDB...
Nov 29 07:17:44 sip /usr/sbin/kamailio[24303]: INFO: {1 9FRQDB7DQM4GLP6UkgPcag..} <script>: route[RELAY]: callid: 9FRQDB7DQM4GLP6UkgPcag.. Relaying
Nov 29 07:17:44 sip /usr/sbin/kamailio[24303]: INFO: {1 9FRQDB7DQM4GLP6UkgPcag..} <script>: [RELAY] callid: 9FRQDB7DQM4GLP6UkgPcag.. from=..... to=..... is a GSM user (0)
Is it possible systemd is taking those "ERROR"s as an indication the service is not starting properly? Even though it is?
my service unit file is like so:
~# cat /etc/systemd/system/multi-user.target.wants/kamailio.service
[Unit]
Description=Kamailio SIP Server
Documentation=man:kamailio(8) http://www.kamailio.org/
After=syslog.target network-online.target
[Service]
LimitNOFILE=65536
[Service]
Type=forking
User=kamailio
Environment=SHM_SIZE=1024
Environment=PKG_SIZE=256
ExecStartPre=/usr/sbin/kamailio -c
ExecStart=/usr/sbin/kamailio -m $SHM_SIZE -M $PKG_SIZE -x fm -X fm -f /etc/kamailio/kamailio_gsm.cfg
ExecStopPost=/usr/bin/rm -f /run/kamailio/kamailio.pid
PIDFile=/run/kamailio/kamailio.pid
Restart=on-failure
RestartSec=30
[Install]
WantedBy=multi-user.target
Thanks everyone.