HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Secure OS Software for Linux
cancel
Showing results for 
Search instead for 
Did you mean: 

Process killed while printing

 
pumabr
Occasional Visitor

Process killed while printing

Hi everybody.
I will really apreciate any help about the following issue:
In my hp-ux 11.0 server I scheduled a script into de cron; part of what this is script does is send to print a file. All the steps before printing works fine, but the process es Killed when try to execute the command that prints the file:
cat /opt/c001/300/tl/scripts/landscape.prn $ERRFILE | lp -d$IMPRESORA

If I run the same instruction from de promt it works, but when is scheduled not. I am using jetdirect v10.34

Thanks a lot.


3 REPLIES
Ivan Ferreira
Honored Contributor

Re: Process killed while printing

Always use the full path for commands in your scripts executed by cron. Also, ensure that the $ERRFILE and $IMPRESORA variables are defined in the script and not in the "profile" for example, or source the profile at the begining of the script.

Also redirect the script output to a log file to try to identify the problem, for example:

0 1 * * * /your/print/script > /tmp/script.out 2>&1
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
pumabr
Occasional Visitor

Re: Process killed while printing

Ivan,
Thanks for your response. I did what you recomended, using full path for commands but it does not work yet. I also redirect the script to an output file, it only has:
----/tmp> more u1.out
/opt/c001/300/tl/scripts/u1[6]: 8376 Killed
/opt/c001/300/tl/scripts/u1[7]: 8380 Killed

any other idea?

Regards.
Ivan Ferreira
Honored Contributor

Re: Process killed while printing

This is a problem hard to identify, a core file is generated somewhere?

I would try to diagnose the problem by using strace, for example, using strace, copare what is happening when you run from command line and from cron:

# strace -o strace.out /your/print/script.sh


1 12 * * * /usr/bin/strace -o /tmp/strace.out /your/print/script.sh

The strace output is not simple and you will see a lot of imformation. You should analyze the output carefully.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?