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


In reply to IPC::Shareable::SharedMem: shmget: Permission denied by katharnakh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.