POSIX message queue size

Hi all,
Please tell me how to change POSIX message queue maximum size? "ulimit" is not a solution because it controls shell resources. But i need to control queue size before login in and starting the shell. It is needed to limit queue size for applications started before login in.
Sorry for my bad english.
Thanks.

There is a kernel parameter CONFIG_POSIX_MQUEUE that turns mqueues off/on. mqueues use kernel resources.

What problem are you having?

The default queue size is 819200 bytes. We can change this value by invoking "ulimit -q". But it only changes the queue size for the current shell and applications run by it. I have some application that must be invoked on system start (before login in and starting shell). And i need to increase the queue size for them. But i can't use "ulimit -q" command. Because the shell hasn't been started yet.
Also i can't use the "/etc/limits.conf" file to specify queue size. Because: "note that all limit settings are set per login. They are not global, nor are they permanent".

Can't you start the application from a simple shell wrapper which sets the appropriate limits, then execs the application?

/bin/bash/ -c "ulimit -q 12288; exec /bla/bla/application -argument"

Right?
What if the applications must be run by init-scripts? So...

/bin/bash/ -c "ulimit -q 12288; exec /bla/bla/initscriptname -argument"

Is there any kernel options to specify POSIX queue size?
I found information about /proc/sys/fs/mqueue/. But there are no files to specify queue size. Only message size, messages count and queues count.

Can't you edit or wrap the init script then? They too are usually just shell scripts.

Mmm... I peeped in one of the init scripts. The problem is why the limits aren't applied before login. So the init-script invoke the following:

/bin/sh -c ulimit -n 5 ;/bin/bash -l -c "/one/two/appl start"

If I invoke "ps -ef" after login in i can see the string above. application "appl" running successfully. Why?
But after login all actions with "appl" failed. Because ulimit works for some reason...

I don't understand your question really, but I don't think the ulimit you set for sh will apply for the separate bash process. You want something like

#!/bin/sh
ulimit -n 5
/one/two/appl start

... or bash if you really think you have a reason to prefer that (but it shouldn't be necessary, even if appl is a bash script).