Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > IPC::Shareable::SharedMem: shmget: Permission denied

Reply
Thread Tools

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

 
 
kath
Guest
Posts: n/a
 
      01-16-2009
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.

 
Reply With Quote
 
 
 
 
kath
Guest
Posts: n/a
 
      01-19-2009
On Jan 16, 1:56 pm, Daniel Molina Wegener
<(E-Mail Removed)> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> kath <(E-Mail Removed)>
> on Friday 16 January 2009 03:59
> wrote in comp.lang.perl.misc:
>
>
>
> > 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+y9T k8sUZW2B8rSq3A
> 74IAnA3/AThKFEeAntYehpFK8QDCb4rG
> =VtpM
> -----END PGP SIGNATURE-----


Thanks, the problem got resolved.

katharnakh.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed: The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {555F3418-D99E-4E51-800A-6E89CFD8B1D7} to the user NT AUTHORITY\LOCAL SERVICE SID (S-1-5-19). Skybuck Flying Windows 64bit 1 06-29-2009 06:17 PM
Workgroup Permission Denied (Usually) Bob Ryan Wireless Networking 2 09-28-2007 09:46 PM
bash: ./firefox-installer: /bin/sh: bad interpreter: Permission denied damon Firefox 7 08-29-2007 08:50 PM
Can't do setuid and file permission denied Chris Perl 1 10-28-2003 03:34 PM
bash: /root/remstats.pl: /usr/bin/perl: bad interpreter: Permission denied Goblin Perl 1 08-14-2003 11:11 AM



Advertisments