Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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/

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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-05-20 16:26 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (75 votes). Check out past polls.