1826581 Members
3625 Online
109695 Solutions
New Discussion

Explanations for "gs"

 
Raynald Boucher
Super Advisor

Explanations for "gs"

Hello all,
We just ran into a b.. of a problem where a command works successfully when the script containing it is run from the command line but fails when started by Autosys on a remote server. The command is:

exec gs $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "-sOutputFile=$outfile"
$OPTIONS -c .setpdfwrite -f "$infile"

Can anyone explain this command, specifically the "-c .setpdferite" options.
$OPTIONS contains "-dSAFER -dCompatibilityLevel=1.2"

And where can I find which shared libraries gs is referencing?

Thanks
3 REPLIES 3
David Child_1
Honored Contributor

Re: Explanations for "gs"

To see the shared libraries simply run;

ldd gs

You will need to be in the correct directory or use the full path.

What error(s) are you getting when running from Autosys? The main problem I've seen is with the environment settings. When logged into the server and running via command line you may have the correct environment, but unless defined correctly these may not work from Autosys.

David
Heironimus
Honored Contributor

Re: Explanations for "gs"

It looks like you're using GhostScript to convert a file to PDF. BATCH and NOPAUSE mean don't wait for a user to hit enter and just exit as soon as the whole thing is processed. I think "-c .setpdfwrite" is actually a GhostScript shortcut/macro to set a number of options to the values usually needed for PDF output. GhostScript is kind of complicated, it has way too many options to remember, but the documentation is freely available online.

I'm not on an HP right now, but think you can run chatr or ldd on the binary to list the shared libraries.
Raynald Boucher
Super Advisor

Re: Explanations for "gs"

We determined that the invalid environment variable was TMPDIR.
We created a workaround by forcibly setting ot in a local profile script.

Does anyone know what the profile setup order is for a job scheduled remotely by autosys to be executed on a Linux server?

Thanks