Skip to content

Instantly share code, notes, and snippets.

@piraces
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piraces/4a030b6777e4da942c98 to your computer and use it in GitHub Desktop.
Save piraces/4a030b6777e4da942c98 to your computer and use it in GitHub Desktop.
Fix dropbox problem with max_user_watches (compatible with several linux distros).
#!/bin/bash
# Autor: Raul Piraces.
# This script requires "sudo" to be installed.
# Fix dropbox problem with max_user_watches.
# Working on several linux distros (based on ArchLinux, Debian, Ubuntu, Fedora, CentOS, etc.).
FILE="/usr/lib/sysctl.d/50-default.conf"
FILE2="/etc/sysctl.conf"
if [ -f $FILE ];
then
echo "[X] Aplicando solucion 1..."
echo "fs.inotify.max_user_watches = 100000" | sudo tee --append $FILE
echo "[X] Solucion 1 aplicada"
sudo systemctl restart dropbox.service
echo "Reinicie dropbox manualmente para finalizar (puede no haberse reiniciado automáticamente)."
else
echo "Solucion 1 no compatible"
echo "Aplicando solucion 2..."
echo "fs.inotify.max_user_watches = 100000" | sudo tee --append $FILE2
sudo sysctl --system
sudo sysctl -p
echo "[X] Solucion 2 aplicada"
echo "Reiniciando dropbox..."
sudo service dropbox restart
sudo systemctl restart dropbox.service
echo "Completado, si ha surgido un fallo al reiniciar el servicio, tratelo de reiniciar manualmente."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment