IPC::Shareable::SharedMem: shmget: Permission denied

K

kath

Hi,
I have a simple script to test variable sharing between two perl
processes,
use IPC::Shareable;
$robj = {status=>'init'};
tie $robj->{status}, 'IPC::Shareable', 'data_glue', {create => 1, mode
=> 664, destroy => 1};
$pid = fork();
unless(defined $pid){
print "Error durigng fork\n";
}
if($pid){
$robj->{parent=>'parent'};
}else{
tie $robj->{status}, 'IPC::Shareable', 'data_glue', {create => 0, mode
=> 664, destroy => 0};
$robj->{status} = 'updated';
sleep(5);
exit(0);
}
print "\n", $robj->{status}, "\n";

When i run i get following error.
IPC::Shareable::SharedMem: shmget: Permission denied
at /usr/lib/perl5/site_perl/5.8.3/IPC/Shareable.pm line 566
Could not create shared memory segment:
at test_ipc_shareable.pl line 3

Problem: I get above error when run as user account other than
'root' . But the script used to work before, but started throwing this
error, after server where this script runs was down due to storage
corruption. I am getting this error after server came online.
I am using perl v5.8.3 and IPC::Shareable v0.60. I tried reinstalling
the package, using cpan shell, force make IPC::Shareable', but the
unfortunately 'test IPC::Shareable' fails.

Does any one know how to resolve this? Because running as 'root'
creates other problems for my main scripts.

Thanks in advance,
katharnakh.
 
K

kath

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

kath <[email protected]>
Hi,
I have a simple script to test variable sharing between two perl
processes,
use IPC::Shareable;
$robj = {status=>'init'};
tie $robj->{status}, 'IPC::Shareable', 'data_glue', {create => 1, mode
=> 664, destroy => 1};
$pid = fork();
unless(defined $pid){
print "Error durigng fork\n";
}
if($pid){
$robj->{parent=>'parent'};
}else{
tie $robj->{status}, 'IPC::Shareable', 'data_glue', {create => 0, mode
=> 664, destroy => 0};
$robj->{status} = 'updated';
sleep(5);
exit(0);
}
print "\n", $robj->{status}, "\n";
When i run i get following error.
IPC::Shareable::SharedMem: shmget: Permission denied
at /usr/lib/perl5/site_perl/5.8.3/IPC/Shareable.pm line 566
Could not create shared memory segment:
at test_ipc_shareable.pl line 3

Well, you are making the user to create the block under 0664
permissions, are the both users in the same group? In other case,
if both users are on different group they can't handle the shared
memory block.

If you are under Linux, remember that when you create a new user,
the user holds a new individual group, and is not invited to new
groups until you invite him.

Try setting both users in the same group by inviting them...


Problem: I get above error when run as user account other than
'root' . But the script used to work before, but started throwing this
error, after server where this script runs was down due to storage
corruption. I am getting this error after server came online.
I am using perl v5.8.3 and IPC::Shareable v0.60. I tried reinstalling
the package, using cpan shell, force make IPC::Shareable', but the
unfortunately 'test IPC::Shareable' fails.
Does any one know how to resolve this? Because running as 'root'
creates other problems for my main scripts.
Thanks in advance,
katharnakh.

Best regards,
- --
.O. | Daniel Molina Wegener | FreeBSD & Linux
..O | dmw [at] coder [dot] cl | Open Standards
OOO |http://coder.cl/ | FOSS Developer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)

iEYEARECAAYFAklwS8EACgkQxyPEFPXO3WEmzQCdGyopJC+y9Tk8sUZW2B8rSq3A
74IAnA3/AThKFEeAntYehpFK8QDCb4rG
=VtpM
-----END PGP SIGNATURE-----

Thanks, the problem got resolved.

katharnakh.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top