A user may set LimitNOFILE through systemd or other means to set
the maximum number of open file descriptors. Only modify the ulimit
if not already set to a higher value by the user.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Gospodarek <gospo@redhat.com>
# On Linux, ovs-vswitchd needs about three file descriptors
# per bridge and one file descriptor per bridge port, so this
# allows a very large number of bridges and ports.
- ulimit -n 7500
+ MAXFD=7500
+ if [ $(ulimit -n) -lt $MAXFD ]; then
+ ulimit -n $MAXFD
+ fi
# Start ovs-vswitchd.
set ovs-vswitchd unix:"$DB_SOCK"