Aug 262015

With ulimit -n you can see what the maximum number of open files can be. As superuser you can change that -per session- with the ulimit command, but an ordinary user can not do that. Therefore, you need to change the /etc/security/limits.conf file. For instance:

* soft nofile 10000
* hard nofile 10000

Meaning that the hard and soft limit are now increased to 10000. I didn’t know that this does not change the limits for the superuser. The asterisk (*) is not intended to change superuser limits. Instead, repeat both lines, changing the asterisk to the word root. You might need a reboot for that, but that’s all.

I needed this for Neo4j and was surprised to see that normal users could have more open files than the superuser. No more, I say, no more!

Nov 092014

I edited /etc/sudoers without visudo, and made a mistake. That will prevent you from successfully using sudo again. No real harm done, but it takes rebooting to get it fixed.

1) reboot in recovery mode (press escape when booting so the grub options are shown)
2) drop to a root shell (option in the recovery menu)
3) mount -o rw,remount /
4) visudo (emacs based editor)
5) reboot the system

You should be up and running again!