diff --git a/debian/resources/switch/source-release.sh b/debian/resources/switch/source-release.sh index d316dee..3eb521c 100755 --- a/debian/resources/switch/source-release.sh +++ b/debian/resources/switch/source-release.sh @@ -11,10 +11,10 @@ apt-get install -y --force-yes freeswitch-video-deps-most #git clone https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch #git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch -cd /usr/src && wget http://files.freeswitch.org/freeswitch-releases/freeswitch-1.6.7.zip -unzip freeswitch-1.6.7.zip +cd /usr/src && wget http://files.freeswitch.org/freeswitch-releases/freeswitch-1.6.9.zip +unzip freeswitch-1.6.9.zip rm -R freeswitch -cp -R freeswitch-1.6.7 freeswitch +cp -R freeswitch-1.6.9 freeswitch cd freeswitch #./bootstrap.sh -j @@ -34,3 +34,9 @@ make install make sounds-install moh-install make hd-sounds-install hd-moh-install make cd-sounds-install cd-moh-install + +useradd freeswitch + +#configure system service +ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/fs_cli +cp "$(dirname $0)/source/freeswitch.service" /lib/systemd/system/freeswitch.service \ No newline at end of file diff --git a/debian/resources/switch/source/freeswitch.service b/debian/resources/switch/source/freeswitch.service new file mode 100644 index 0000000..ae08231 --- /dev/null +++ b/debian/resources/switch/source/freeswitch.service @@ -0,0 +1,54 @@ +;;;;; Author: Travis Cross + +[Unit] +Description=freeswitch +After=syslog.target network.target local-fs.target postgresql.service + +[Service] +; service +Type=forking +PIDFile=/run/freeswitch/freeswitch.pid +Environment="DAEMON_OPTS=-nonat" +EnvironmentFile=-/etc/default/freeswitch +ExecStart=/usr/local/freeswitch/bin/freeswitch -u freeswitch -g freeswitch -ncwait $DAEMON_OPTS +TimeoutSec=45s +Restart=always +; exec +User=root +Group=daemon +LimitCORE=infinity +LimitNOFILE=100000 +LimitNPROC=60000 +LimitSTACK=240K +LimitRTPRIO=infinity +LimitRTTIME=7000000 +IOSchedulingClass=realtime +IOSchedulingPriority=2 +CPUSchedulingPolicy=rr +CPUSchedulingPriority=89 +UMask=0007 + +; alternatives which you can enforce by placing a unit drop-in into +; /etc/systemd/system/freeswitch.service.d/*.conf: +; +; User=freeswitch +; Group=freeswitch +; ExecStart= +; ExecStart=/usr/bin/freeswitch -ncwait -nonat -rp +; +; empty ExecStart is required to flush the list. +; +; if your filesystem supports extended attributes, execute +; setcap 'cap_net_bind_service,cap_sys_nice=+ep' /usr/bin/freeswitch +; this will also allow socket binding on low ports +; +; otherwise, remove the -rp option from ExecStart and +; add these lines to give real-time priority to the process: +; +; PermissionsStartOnly=true +; ExecStartPost=/bin/chrt -f -p 1 $MAINPID +; +; execute "systemctl daemon-reload" after editing the unit files. + +[Install] +WantedBy=multi-user.target \ No newline at end of file