Hi All,
After some effort searching though the ifhp code I finally decided what
(I think) is wrong and seemingly fixed it.
It appears that after the last modifications to ifhp the Make_tempfile
code was changed to accommodate the passing of filenames and therefore
in the case of a filename pointer being passed, the temp file is NOT
unlinked after being created and no other unlink is ever performed -
hence the most annoying ifhpXXXXXXX files remain - at least, thats how I
understand it!
So, my solution after searching around and finding the (IMHO dirty)
Global InputFile pointer I implemented a simple bit of code that checks
to make sure that InputFile is not the same as the passed -e value nor
equal to /dev/fd/0 and then unlinks the file.
I tested and installed the new ifhp on our servers and so far it seems
to be working fine, i.e. no complaints yet!. The biggest difference
however is with the /var/spool/lpd directory, in our most loaded server
it used to be around 1.5 to 2gb full at any one time, now it floats
around 300 to 500 mb, which is much better!
A diff between the last ifhp.c (3.5.10) and mine should be attached...
perhaps something similar should be integrated into the original ifhp
and to that end, if anyone thinks it should be done differently, please
say!
Cheers,
Sam Lown
--
CERN, Geneva
IT - Product Support - Unix Infrastructure
E-mail: [EMAIL PROTECTED]
423a424
>
1346a1348,1364
> /* Added by Sam Lown, CERN
> * Based on info provided by Bernhard Koelbl, InterFace AG
> * - This is a bit messy but with passing variables through globals
> * one can never be sure what the state is!
> */
>
> /* Check again for the -e option */
> if( (s = Loweropts['e'-'a']) ){
> /* we have a file specified on the command line */
> if ( safestrcmp(s,InputFile) || safestrcmp(Devfd0, InputFile) ) {
> DEBUG1("End_of_job: Unlinking Temporary file '%s'", InputFile);
> unlink(InputFile);
> }
> }
>
> /* End of addition */
>