Freeswitch的系统启动不一致 [英] Inconsistent systemd startup of freeswitch

查看:522
本文介绍了Freeswitch的系统启动不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从systemd运行freeswitch时遇到两个问题:

I have two problems running freeswitch from systemd :

编辑2-我已经将启动缓慢的问题移到了这里( Freeswitch在centos 7.1上启动时会在check_ip上暂停),尽管它们可能相关,但作为独立版本可能不错。

EDIT 2 - I have moved the slow start up question to here (Freeswitch pauses on check_ip at boot on centos 7.1) as although they may be related it's probably good as a standalone.

编辑-我注意到了其他情况。从那里运行时,请查看从终端输出捕获的以下几行。差距是4分钟,但是大约10分钟之前。我注意到了这是因为我试图找出为什么8021端口要花几分钟才能接受fs_cli连接。为什么会这样?以前从未发生过,我已经安装了FS盒子。这对1.7&今日1.6。

EDIT - I have noticed something else. Look at these next lines captured from the terminal output when running it from there. The gap is 4 minutes but it has been around 10 minutes before. I noticed it because I was trying to find out why port 8021 was taking several minutes to accept the fs_cli connection. Why does this happen? Never happened to me before and I've installed loads of FS boxes. This does the same thing on both 1.7 & todays 1.6.


2015-10-23 12:57:35.280984 [DEBUG] switch_scheduler.c:249 Added task 1 heartbeat (core) to run at 1445601455
2015-10-23 12:57:35.281046 [DEBUG] switch_scheduler.c:249 Added task 2 check_ip (core) to run at 1445601455
2015-10-23 13:01:31.100892 [NOTICE] switch_core.c:1386 Created ip list rfc6598.auto default (deny)





  1. 有时我会启动双重流程。这是发生这种情况后的状态行:




# systemctl status freeswitch -l
freeswitch.service - freeswitch
   Loaded: loaded (/etc/systemd/system/multi-user.target.wants/freeswitch.service)
   Active: activating (start) since Fri 2015-10-23 01:31:53 BST; 18s ago
 Main PID: 2571 (code=exited, status=0/SUCCESS);         : 2742 (freeswitch)
   CGroup: /system.slice/freeswitch.service
           ├─usr/bin/freeswitch -ncwait -core -db /dev/shm -log /usr/local/freeswitch/log -conf /usr/local/freeswitch/conf -run /usr/local/freeswitch/run
           └─usr/bin/freeswitch -ncwait -core -db /dev/shm -log /usr/local/freeswitch/log -conf /usr/local/freeswitch/conf -run /usr/local/freeswitch/run
Oct 23 01:31:53 fswitch-1 systemd[1]: Starting freeswitch...
Oct 23 01:31:53 fswitch-1 freeswitch[2742]: 2743 Backgrounding.


,并且有两个进程正在运行。

and there are two processes running.


  1. PID文件有时写得不够快,无法被systemd进程拾取,但是到我看到的时候(无论如何我运行命令的速度很快)到我做的时候它总是在这里:




Oct 23 02:00:26 arribacom-sbc-1 systemd[1]: PID file
/usr/local/freeswitch/run/freeswitch.pid not readable (yet?) after
start.


现在,在(2)中,一切似乎正常,并且我可以使用

Now, in (2) everything seems to work ok, and I can shut down the freeswitch process using


systemctl stop freeswitch

没有任何问题,但是在(1)中,它似乎没有任何作用。

without any issues, but in (1) it just doesn't seem to do anything.

我想知道两者是否相关,并且freeswitch正在向systemd报告该程序在实际运行之前正在运行。然后systemd正在启动另一个进程,或者(有时)没有启动。

I'm wondering if the two are related, and that freeswitch is reporting back to systemd that the program is running before it actually is. Then systemd is either starting up another process or (sometimes) not.

有人可以提供任何指针吗?我曾尝试向freeswitch用户列表发送邮件,但是尽管已注册,但我根本无法在列表中显示任何电子邮件(但这是另一个问题)。

Can anyone offer any pointers? I have tried to mail the freeswitch users list but despite being registered I simply cannot get any emails to appear on the list (but that's another problem).

*更新*
如果我删除了-ncwait,似乎可以改善双进程的启动,但是我仍然收到无法读取的PID警告,因此我仍然确定存在问题,可能是在计时方面(?)。

* Update * If I remove the -ncwait it seems to improve the double process starting but I still get the can't read PID warning, so I'm still sure there's an issue present, possibly around timing(?).

我使用的是Centos 7.1,我的freeswitch版本是

I'm on Centos 7.1, & my freeswitch version is


FreeSWITCH Version 1.7.0+git~20151021T165609Z~9fee9bc613~64bit (git
9fee9bc 2015-10-21 16:56:09Z 64bit)


这是我的freeswitch.service文件(有些注释已经注释掉,直到我了解它们的作用以及可能产生的任何副作用):

and here's my freeswitch.service file (some things have been commented out until I understand what they are doing and any side effects they may have) :


[Unit]
Description=freeswitch
After=syslog.target network.target
#
[Service]
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
PermissionsStartOnly=true
ExecStart=/usr/bin/freeswitch -nc -core -db /dev/shm -log /usr/local/freeswitch/log -conf /u
ExecReload=/usr/bin/kill -HUP $MAINPID
#ExecStop=/usr/bin/freeswitch -stop
TimeoutSec=120s
#
WorkingDirectory=/usr/bin
User=freeswitch
Group=freeswitch
LimitCORE=infinity
LimitNOFILE=999999
LimitNPROC=60000
LimitSTACK=245760
LimitRTPRIO=infinity
LimitRTTIME=7000000
#IOSchedulingClass=realtime
#IOSchedulingPriority=2
#CPUSchedulingPolicy=rr
#CPUSchedulingPriority=89
#UMask=0007
#
[Install]
WantedBy=multi-user.target



推荐答案

在当前的master分支中,从 debian / 目录:

In the current master branch, take the two files from debian/ directory:

freeswitch-systemd.freeswitch.service -应该作为 /lib/systemd/system/freeswitch.service

freeswitch-systemd.freeswitch.tmpfile -应该作为 /usr/lib/tmpfiles.d/freeswitch.conf

调整路径,或构建FreeSWITCH以使用标准Debian路径。

You probably need to adapt the paths, or build FreeSWITCH to use standard Debian paths.

这篇关于Freeswitch的系统启动不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆