ceph/teuthology/task/adjust-ulimits
Zack Cerza 8e37361b9a Via automagic, only call ulimit -n if running as root.
Also, add comments because comments are cool.
2013-09-05 16:30:28 -05:00

17 lines
299 B
Bash
Executable File

#!/bin/sh
# If we're running as root, allow large amounts of open files.
USER=$(whoami)
# If a ulimit call fails, exit immediately.
set -e
if [ "$USER" = "root" ]
then
# Enable large number of open files
ulimit -n 16384
fi
# Enable core dumps for everything
ulimit -c unlimited
exec "$@"