forked from norman/fusionpbx-install.sh-github-mirror
CentOS 7 Installer (#71)
This commit is contained in:
committed by
FusionPBX
parent
fbdca20dee
commit
e1e6e06162
3
centos/resources/switch/conf-copy.sh
Normal file
3
centos/resources/switch/conf-copy.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
mv /etc/freeswitch /etc/freeswitch.orig
|
||||
mkdir /etc/freeswitch
|
||||
cp -R /var/www/fusionpbx/resources/templates/conf/* /etc/freeswitch
|
||||
6
centos/resources/switch/package-permissions.sh
Normal file
6
centos/resources/switch/package-permissions.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#default permissions
|
||||
chown -R freeswitch:daemon /etc/freeswitch
|
||||
chown -R freeswitch:daemon /var/lib/freeswitch
|
||||
chown -R freeswitch:daemon /usr/share/freeswitch
|
||||
chown -R freeswitch:daemon /var/log/freeswitch
|
||||
chown -R freeswitch:daemon /var/run/freeswitch
|
||||
24
centos/resources/switch/package-release.sh
Normal file
24
centos/resources/switch/package-release.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
#move to script directory so all relative paths work
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
. ../colors.sh
|
||||
. ../arguments.sh
|
||||
|
||||
verbose "Installing FreeSWITCH"
|
||||
|
||||
yum -y install memcached curl gdb
|
||||
yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm
|
||||
yum install -y freeswitch-config-vanilla freeswitch-lang-* freeswitch-sounds-* freeswitch-lua freeswitch-xml-cdr
|
||||
|
||||
##remove the music package to protect music on hold from package updates
|
||||
mkdir -p /usr/share/freeswitch/sounds/temp
|
||||
mv /usr/share/freeswitch/sounds/music/*000 /usr/share/freeswitch/sounds/temp
|
||||
yum -y remove freeswitch-sounds-music
|
||||
mkdir -p /usr/share/freeswitch/sounds/music/default
|
||||
mv /usr/share/freeswitch/sounds/temp/* /usr/share/freeswitch/sounds/music/default
|
||||
rm -R /usr/share/freeswitch/sounds/temp
|
||||
|
||||
verbose "FreeSWITCH installed"
|
||||
|
||||
3
centos/resources/switch/package-systemd.sh
Normal file
3
centos/resources/switch/package-systemd.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
rm -f /lib/systemd/system/freeswitch.service
|
||||
cp "$(dirname $0)/source/freeswitch.service.package" /lib/systemd/system/freeswitch.service
|
||||
cp "$(dirname $0)/source/etc.default.freeswitch" /etc/sysconfig/freeswitch
|
||||
4
centos/resources/switch/source/etc.default.freeswitch
Normal file
4
centos/resources/switch/source/etc.default.freeswitch
Normal file
@@ -0,0 +1,4 @@
|
||||
# /etc/default/freeswitch
|
||||
FS_USER="freeswitch"
|
||||
FS_GROUP="daemon"
|
||||
DAEMON_OPTS="-nonat -ncwait -u freeswitch -g daemon -run /var/run/freeswitch"
|
||||
55
centos/resources/switch/source/freeswitch.service.package
Normal file
55
centos/resources/switch/source/freeswitch.service.package
Normal file
@@ -0,0 +1,55 @@
|
||||
;;;;; Author: Travis Cross <tc@traviscross.com>
|
||||
|
||||
[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
|
||||
ExecStartPre=/bin/mkdir -p /var/run/freeswitch/
|
||||
ExecStartPre=/bin/chown -R freeswitch:daemon /var/run/freeswitch/
|
||||
ExecStart=/usr/bin/freeswitch -u freeswitch -g daemon -ncwait $DAEMON_OPTS
|
||||
TimeoutSec=45s
|
||||
Restart=always
|
||||
; exec
|
||||
User=root
|
||||
Group=daemon
|
||||
LimitCORE=infinity
|
||||
LimitNOFILE=100000
|
||||
LimitNPROC=60000
|
||||
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
|
||||
55
centos/resources/switch/source/freeswitch.service.source
Normal file
55
centos/resources/switch/source/freeswitch.service.source
Normal file
@@ -0,0 +1,55 @@
|
||||
;;;;; Author: Travis Cross <tc@traviscross.com>
|
||||
|
||||
[Unit]
|
||||
Description=freeswitch
|
||||
After=syslog.target network.target local-fs.target postgresql.service haveged.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 www-data -g www-data -ncwait $DAEMON_OPTS
|
||||
;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
|
||||
Reference in New Issue
Block a user