Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here is a little piece of a script I wrote to push the limits up on an Ubuntu box during setup (AWS).

    # Increase File Descriptor limits.
    export FILEMAX=`sysctl -n fs.file-max`
    sudo mv /etc/security/limits.conf /etc/security/limits.conf.bak
    sudo touch /etc/security/limits.conf
    sudo chmod 666 /etc/security/limits.conf
    echo "root soft nofile $FILEMAX" >> /etc/security/limits.conf
    echo "root hard nofile $FILEMAX" >> /etc/security/limits.conf
    echo "* soft nofile $FILEMAX" >> /etc/security/limits.conf
    echo "* hard nofile $FILEMAX" >> /etc/security/limits.conf
    sudo chmod 644 /etc/security/limits.conf

    touch /home/ubuntu/.bash_profile
    echo "ulimit -n $FILEMAX" >> /home/ubuntu/.bash_profile

    # Increase Ephemeral Ports.
    sudo chmod 666 /etc/sysctl.conf
    echo "net.ipv4.ip_local_port_range = 1024 65535" >> /etc/sysctl.conf
    sudo chmod 644 /etc/sysctl.conf


You know it's odd. One one hand, the almost-greybeard in me wants people to stop screwing around with what I take to be standard unix concepts... what are the ephemeral ports, etc.

On the other hand, when I take a close look at something like what you just posted, the level of control is hard to argue with - nothing wrong with that.

The temptation is still to basically do what you did (thanks BTW) and just revert everything back to what it rightfully should be.... it served us just fine for ages.

Or I'll switch to FreeBSD ,unless they're doing the same thing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: