The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
message queue etenv High Level Programming 2 11-02-2007 02:09 AM
posix ipc message queue cadanir HP-UX 6 05-01-2006 04:59 PM
Message Queue with fork() help strider High Level Programming 1 01-13-2006 07:59 AM
Unix message Queue kel UNIX for Advanced & Expert Users 3 07-30-2003 08:12 AM
POSIX Message Queue - Settings Deepa High Level Programming 0 02-07-2003 07:13 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-05-2008
Vourhey's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 6
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.
Reply With Quote
Forum Sponsor
  #2  
Old 06-05-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
There is a kernel parameter CONFIG_POSIX_MQUEUE that turns mqueues off/on. mqueues use kernel resources.

What problem are you having?
Reply With Quote
  #3  
Old 06-05-2008
Vourhey's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 6
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".
Reply With Quote
  #4  
Old 06-05-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
Can't you start the application from a simple shell wrapper which sets the appropriate limits, then execs the application?
Reply With Quote
  #5  
Old 06-05-2008
Vourhey's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 6
Code:
/bin/bash/ -c "ulimit -q 12288; exec /bla/bla/application -argument"
Right?
What if the applications must be run by init-scripts? So...
Code:
/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.

Last edited by Vourhey; 06-05-2008 at 06:53 AM.
Reply With Quote
  #6  
Old 06-05-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
Can't you edit or wrap the init script then? They too are usually just shell scripts.
Reply With Quote
  #7  
Old 06-06-2008
Vourhey's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 6
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:
Code:
/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...
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0