Secure OS Software for Linux
1753910 Members
8907 Online
108810 Solutions
New Discussion юеВ

Re: Process killed while printing

 
pumabr
New Member

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 3
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
New Member

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?