Anno said:
It would have been a good idea to mention that explicitly in the body of
your posting. "Launched from rc" is not part of any standard terminology.
I would have expected any experience Unix person to know what an rc
script is and the related terminology, but no matter.
The behavior depends heavily on *when* the script is run during the
startup process. "Run at boot" is much too unspecific.
OK, run level 3. About one of the last scripts to run.
The Perl scripts aren't identical, are they?
Its the same script. The only difference I can see is the fact that
there's no pseudo-tty attached to the processes run from init.d.
I bet the pipe isn't the only difference. In fact, pipe behavior sounds like a rather unlikely
candidate.
Yes, I don't think it is. There was one point where I had an explicit
exit in the perl script after it read in a config file (I was printing
the config options back out to ensure it was doing it correctly). The
exit caused the other program on the front of the pipe to die. I then
spent some time trying to work out if it was a SIGPIPE problem (by
sending kill -PIPE signals to that program) to no effect. So the exit
in the perl script must send a different signal back (although I'm not
sure why. I would expect SIGPIPE but HP-UX has some oddities).
I have no idea. Post the code of the script, the actual call, and
describe in what stage of startup the call happens.
Its a bit difficult due to commercial obligations (contracts, etc. I'm
sure you're aware of the issues).
Anyway, if you must know, I took an existing perl script found here -
http://www.peppler.org/downloads/scripts (Its the one called
log_watcher.pl.)
and modified it to read from stdin (i.e. a pipe) rather than from a
file location. I also optimised the regexps and cleaned up some of the
logic. It all works fine (at least when I start the scripts
interactively).
Is perl even part of the HPUX 11 distribution?
I have no idea. 'perl -v' reports -
This is perl, v5.8.0 built for PA-RISC1.1-thread-multi
(with 1 registered patch, see perl -V for more detail)
Are all modules your script may be using?
I'm not sure what you mean.
In fact, you might be better off asking in a HPUX-oriented newsgroup.
The problem may not be specific to perl at all.
I can't find a specific HP-UX group under comp.unix.*. I might try a
generic one later if I still can't solve this.