Had a very strange thing happen today. I am working on packaging software into pkg (Sun), rpm (SuSE) and installp (AIX) formats. Part of the post install features of the package is that it runs a perl script to configure the software that's been laid onto disk. The post install procedure for installp on AIX is basically to run a shell script, and in that shell script I have it do:

su - softwareUser -c /path/to/my/script.pl

The package, as with every package installation across all the platforms I've dealt with, runs as root. So in order to have the script run with the correct authority the 'su' is needed. So that's all the background.

What I had was a simple block of code:

my $confgiFile = '/path/to/configFile'; open ( CONFIG, ">$configFile" ) or die "FATAL :: failure configuring - + $!\n\n"; print CONFIG $config; # $config is populated much earlier close(CONFIG);

That was dandy on Sun and Linux. On AIX, I kept getting errors saying "The file permissions do not allow the specified action".

The strange part was that I had another piece of code that worked fine just above it:

open ( OTHERCONFIG, ">/path/to/otherconfigFile" ) or die "FATAL :: fai +lure configuring - $!\n\n"; print OTHERCONFIG $otherConfig; close(OTHERCONFIG);

The 'OTHERCONFIG' worked fine. Permissions on the files were identical. Permissions that were identical on the other platforms worked fine. It was running as the same user. The same operation worked on AIX 5.2 with the same perl version. very, very, very odd...

So I changed the first one to use a real path instead of a variable (a bit of a pain b/c the path is different on each platform so I have to make sure that is changed down in the bowels of the script instead of manipulating a variable at the top). Now it works, too.

I've been poking around doc and google, but no luck finding a cause for this. Anyone else have ideas? We worked around it in a way I'm mostly happy with, but I'm very curious why it happened...

We speak the way we breathe. --Fugazi

In reply to perl 5.6.1 on AIX 5.1 doesn't open() a $var, only real path by jptxs

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.