sudo command redundant on swapfile create
authorJeff Atwood <jatwood@codinghorror.com>
Tue, 10 May 2016 09:10:06 +0000 (02:10 -0700)
committerJeff Atwood <jatwood@codinghorror.com>
Tue, 10 May 2016 09:10:06 +0000 (02:10 -0700)
discourse-setup

index 935167a8b698ae9135378caf96b06bc9e3c7f419..268fa0365e8789a0ed6bbd88e441ae130895f2cc 100755 (executable)
@@ -24,7 +24,7 @@ check_disk_and_memory() {
       echo "Without sufficient swap space, your site may not work properly, and future"
       echo "upgrades of Discourse may not complete successfully."
       echo
-      read -p "ENTER to create a 2GB swapfile automatically, or Ctrl-C to exit"
+      read -p "ENTER to create a 2GB swapfile now (you will need to be root), or Ctrl-C to exit"
       
       ##
       ## derived from https://meta.discourse.org/t/13880
@@ -34,7 +34,7 @@ check_disk_and_memory() {
       mkswap /swapfile
       swapon /swapfile
       echo "/swapfile       swap    swap    auto      0       0" | sudo tee -a /etc/fstab
-      sudo sysctl -w vm.swappiness=10
+      sysctl -w vm.swappiness=10
       echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
 
       total_swap="$(LANG=C free -m | grep ^Swap: | awk '{print $2}')"