Problem
I have created an application that opens a pipe to send a job to the lp command. This application works fine from the command line. However, if I invoke this application from a Java application via the runtime exec method, the print job does not succeed and a core file is produced. Examination of the core file generated shows that it was the /usr/lpd/remote/lp binary that coredumped. This problem does not occur, however, if the print job is being sent to a local printer.
Solution
This has been reported to SCO Engineering.
As a workaround, you can modify the lp command within the application that is invoked by your Java application to include a "-" at the end of the command. For example, if your original lp command looks like
char *printercmd = "lp -s -dprintername >/dev/null 2>&1";you can change this tochar *printercmd = "lp -s -dprintername - >/dev/null 2>&1";to prevent lp from dumping core.