Skip to content

Commit

Permalink
further improve turnserver install script
Browse files Browse the repository at this point in the history
  • Loading branch information
steveseguin committed Jan 13, 2025
1 parent 098740f commit 672bf89
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions turnserver_install.sh.sample
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ install_coturn() {
apt-get update
apt-get install coturn curl dnsutils -y

# Configure system limits
echo "fs.file-max = 65535" >> /etc/sysctl.conf
sysctl -p
ulimit -n 65535
# Configure system limits
echo "fs.file-max = 65535" >> /etc/sysctl.conf
sudo sysctl -p
# Add permanent ulimit settings
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.conf
echo "root soft nofile 65535" >> /etc/security/limits.conf
echo "root hard nofile 65535" >> /etc/security/limits.conf

# Enable TURN server
echo "TURNSERVER_ENABLED=1" > /etc/default/coturn
Expand Down Expand Up @@ -141,6 +145,17 @@ EOL
systemctl start coturn
}

# Swap setup
if [ -f /swapfile ]; then
sudo swapoff -a
sudo rm /swapfile
fi
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

# Main script execution
echo "TURN Server Installation and Configuration"
echo "----------------------------------------"
Expand Down

0 comments on commit 672bf89

Please sign in to comment.