Open file resource limit

Hi there,
I am getting warnings in error.log;
“[warn] 23770#0: 4096 worker_connections are more than open file
resource limit: 1024”

I did raised “nginx” user open files limit via ulimit;
“[root@proxy ~]# runuser nginx -c “ulimit -n”
40960”

As you think it didn’t worked, then I increased open files for “root” to
40960, the problem has gone. But if I start nginx via an init script I
get the errors again (as expected).

  1. So, must I set ulimit values in init script? Is this right?
  2. nginx runs with user “nginx” that limits setted high via
    /etc/security/limits.conf , does root’s limits effects the nginx
    processes? If so, may I safely ignore this warning?