Chef solo and ulimit cookbook (inside redisio cookbook)


#1

Ohai,

I’m experiencing a weird issue when ulimit recipe is called twice and the
second time around it’s running in “wrong” context without seeing the
attributes defined in the JSON file:

This is my JSON:

“redisio”: {
“ulimit”: false,
“servers”: [
{“port”: 10000 },
{“port”: 10001 },
{“port”: 10002 },
{“port”: 10003 },
{“port”: 10004 },
{“port”: 10005 }
],
“version”: “2.8.9”
},
“ulimit”: {
“users”: {
“redis”: {
“filehandle_limit”: 5121,
“process_limit”: 122944,
“stack_limit”: 10240,
“memory_limit”: 65535
}
}

}

This is what happening…

Recipe: redisio::default

  • package[tar] action install (up to date)
  • package[make] action install (up to date)
  • package[automake] action install (up to date)
  • package[gcc] action install (up to date)
    Recipe: ulimit::default
  • template[/etc/security/limits.d/redis_limits.conf] action create
    • update content in file /etc/security/limits.d/redis_limits.conf
      from 9e616d to 8818b1
      — /etc/security/limits.d/redis_limits.conf 2014-06-24
      13:09:20.557465664 -0700
      +++ /tmp/chef-rendered-template20140624-30606-15qqxpt 2014-06-24
      13:17:54.863858533 -0700
      @@ -1,7 +1,9 @@

      Limits settings for redis

      -redis - nofile 10032
      +redis - nofile 5121

      +redis - nproc 122944

      +redis - memlock 65535

Recipe: redisio::install

  • redisio_install[redis-servers] action runRecipe:
  • user[redis] action create (up to date)
  • directory[/etc/redis] action create (up to date)
  • directory[/var/lib/redis] action create (up to date)
  • directory[/var/run/redis/10000] action create (up to date)
  • directory[.] action create (skipped due to only_if)
  • file[/var/lib/redis/appendonly-10000.aof] action create (skipped
    due to only_if)
  • file[/var/lib/redis/dump-10000.rdb] action create (skipped due to only_if)
  • template[/etc/security/limits.d/redis_limits.conf] action create
    • update content in file /etc/security/limits.d/redis_limits.conf
      from 8818b1 to 9e616d
      — /etc/security/limits.d/redis_limits.conf 2014-06-24
      13:17:54.863858533 -0700
      +++ /tmp/chef-rendered-template20140624-30606-1pyhad9 2014-06-24
      13:17:54.883858631 -0700
      @@ -1,9 +1,7 @@

      Limits settings for redis

      -redis - nofile 5121
      +redis - nofile 10032

      -redis - nproc 122944

      -redis - memlock 65535

Any hints will be highly appreciated.

Kind Regards,
Greg

“Contrary to popular belief, UNIX is user friendly. It just happens to be
selective about who it makes friends with.” --Unknown