Does anyone know how to increase the stack size that a daemon can use?

Like: ulimit -s unlimited?

I tried /etc/security/limits.conf but that is not used by the daemon so it doesn't affect it.

Can I use /etc/initscript to solve this? I tried using it but I cannot restart the system after that. Luckily, it's a VM so I just snapshot it before I experiment.