在centos中添加freeswitch服務開機自動運行

來源:互聯網
上載者:User

標籤:des   style   blog   color   os   io   ar   for   art   

建立 /etc/init.d/freeswitch 指令碼,指令碼內容如下: 

#! /bin/sh## freeswitch:       Starts the freeswitch Daemon## chkconfig: 345 96 02# processname: freeswitch# description: Freeswitch fedora init script # config:# Author: gled# Source function library.. /etc/init.d/functions. /etc/sysconfig/networkPATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/freeswitch/binDESC="FreeSwitch Voice Switching System"NAME=freeswitchDAEMON=/usr/local/freeswitch/bin/$NAMEDAEMON_ARGS="-nc"PIDFILE=/usr/local/freeswitch/log/$NAME.pid## SECURITY NOTE: To run as non-root, create a new user for FreeSWITCH and set these variables (FS_GROUP is optional).###FS_USER=freeswitch#FS_GROUP=freeswitchdo_setlimits() {        ulimit -c unlimited        ulimit -d unlimited        ulimit -f unlimited        ulimit -i unlimited        ulimit -n 999999        ulimit -q unlimited        ulimit -u unlimited        ulimit -v unlimited        ulimit -x unlimited        ulimit -s 244        ulimit -l unlimited        return 0}base=${0##*/}do_start() {        if [ -n "${FS_USER}" ]; then                DAEMON_ARGS="${DAEMON_ARGS} -u ${FS_USER}"        fi        if [ -n "${FS_GROUP}" ]; then                DAEMON_ARGS="${DAEMON_ARGS} -g ${FS_GROUP}"        fi        do_setlimits        $DAEMON $DAEMON_ARGS        RETVAL=$?        if [ $RETVAL = 0 ]; then                success $"$base startup"        else                failure $"$base startup"        fi        echo        return $RETVAL}do_stop() {        $DAEMON -stop        RETVAL=$?        [ $RETVAL = 0 ] && success $"$base shutdown" || failure $"$base shutdown"        rm -f $LOCKFILE        echo        return $RETVAL}# See how we were called.case "$1" in  start)        do_start        ;;  stop)        do_stop        ;;  restart)        do_stop        echo "Waiting for daemon to exit..."        sleep 5        do_start        ;;  *)        echo $"Usage: $0 {start|stop}"        exit 2        ;;esacexit $RETVAL

增加指令碼可執行許可權:

chmod +x /etc/init.d/freeswitch

添加開機啟動服務:

chkconfig --add freeswitch 

 

以上,全部。ps,如果發現fs不通,可能是由於防火牆的原因,粗暴的方式請關閉防火牆。

在centos中添加freeswitch服務開機自動運行

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.