- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Secure OS Software for Linux
- >
- How to use IPC msg Q's, msgget etc. ??
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2002 08:49 AM
тАО03-27-2002 08:49 AM
msgget seems to return a handle but if I try to use this in any way I get EACCES or EPERM.
ipcs(8) also reports nothing.
Is there some configuration I need to make to set permissions for message queues?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2002 08:29 AM
тАО03-29-2002 08:29 AM
Re: How to use IPC msg Q's, msgget etc. ??
Are you trying to talk from Compartment to Compartment? if so what are your rules?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2002 08:19 AM
тАО04-02-2002 08:19 AM
Re: How to use IPC msg Q's, msgget etc. ??
I have a new compartment
IPC is between processes in the same compartment.
I wrote a little test program which works fine on other linux but not on HP-LX. (attached)
Is there anything I need to configure for IPC? I found no mention in the man pages.
On other linux the test program reports:-
mid is 196613 and errno is 0
msgctl/STAT return is 0 and errno is 0
msgctl/SET return is 0 and errno is 0
msgsnd return is 0 and errno is 0
and ipcs -q reports
key msqid owner perms used-bytes messages
0x00000000 229382 omu104 660 10 1
on HP-LX I just get.
mid is 163845 and errno is 0
msgctl/STAT return is -1 and errno is 13
msgctl/SET return is -1 and errno is 1
msgsnd return is -1 and errno is 13
and ipcs never reports anything.
Thanks,
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2002 05:41 AM
тАО04-03-2002 05:41 AM
SolutionThanks for the attacthment.
I was able to run this program successfully, here were my steps.
1) create a new compartment
/sbin/tlcompadd
2) change into this compartment
/sbin/tlsetcomp
3) no rules will be required if you stay in the same comparment.
BTW I did get the errors if I tried to run this program from the "system" compartment.
Here are my results and an strace of the success:
[tlinuxadm@viper tlinuxadm]$ /sbin/tlsetcomp msg1
sh-2.04$ ls
a.out message.c
sh-2.04$ ./a.out
mid is 294919 and errno is 0
msgctl/STAT return is 0 and errno is 0
msgctl/SET return is 0 and errno is 0
msgsnd return is 0 and errno is 0
sh-2.04$ ipcs -q
------ Message Queues --------
key msqid owner perms used-bytes messages
0x0000000c 131074 tlinuxadm 660 0 0
0x00000000 294919 104 660 10 1
sh-2.04$ strace ./a.out
execve("./a.out", ["./a.out"], [/* 24 vars */]) = 0
uname({sys="Linux",
node="viper.idev.atl.hp.com", ...}) = 0
brk(0) = 0x8049954
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=32402, ...}) = 0
old_mmap(NULL, 32402, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
close(3) = 0
open("/lib/i686/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\302"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755,
st_size=5634864, ...}) = 0
old_mmap(NULL, 1242920, PROT_READ|PROT_EXEC,
MAP_PRIVATE, 3, 0) = 0x40020000
mprotect(0x40146000, 38696, PROT_NONE) = 0
old_mmap(0x40146000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x125000) = 0x40146000
old_mmap(0x4014c000, 14120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4014c000
close(3) = 0
munmap(0x40018000, 32402) = 0
getpid() = 1556
msgget(IPC_PRIVATE, 0x1b0|0660) = 327688
fstat64(1, {st_mode=S_IFCHR|0620,
st_rdev=makedev(136, 1), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "mid is 327688 and errno is 0\n", 29mid is 327688 and errno is 0
) = 29
msgctl(327688, MSG_???, 0xbffff200) = 0
write(1, "msgctl/STAT return is 0 and errn"..., 39msgctl/STAT return is 0 and errno is 0
) = 39
msgctl(327688, MSG_???, 0xbffff200) = 0
write(1, "msgctl/SET return is 0 and errno"..., 38msgctl/SET return is 0 and errno is 0
) = 38
msgsnd(327688, {1, "123456789\0"}, 10, 0) = 0
write(1, "msgsnd return is 0 and errno is "..., 34msgsnd return is 0 and errno is 0
) = 34
munmap(0x40018000, 4096) = 0
_exit(34) = ?
sh-2.04$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2002 06:34 AM
тАО04-03-2002 06:34 AM
Re: How to use IPC msg Q's, msgget etc. ??
Kevin