Signal handling and error_log messages

Bill Marr billm at tharo.com
Wed Mar 14 08:29:11 PDT 2007


Hello all,

   I've been developing a new filter for the past month or so for my employer which will support our line of thermal-transfer labelling printers. I based it on the Zebra/Dymo rastertolabel filter. I've searched throughout the forums here on the CUPS website, googled, yahooed, etc., but I cannot figure out how to get messages sent to the CUPS error_log AFTER a signal handler is called. I'm using alot of DEBUG messages so that I can make sure my printer filter is working properly, and code like the following never gets into the error_log after a print job is cancelled:

   ... (signal received and handled) ...
   ... (back in main() function) ...

   fputs("DEBUG: rastertotpl, main() - job cancelled.\n", stderr);

   ... (main() cleanup and exit) ...

What I've been doing is watching the error_log with:

   # > tail -f error_log | grep rastertotpl

   to see all of my debug output, as I always precede each message with the string "DEBUG: rastertotpl, ", then some info as appropriate.

   I've been going over the GNU libc info pages on signal handling (must have read thru those like half-a-dozen times already), and trying different things, but I still get no debug output in error_log. My filter works great; it's just that the cancelling of jobs is giving me trouble in regards to getting output into the error_log.

   I should also note that this is my first real GNU/Linux project (simple "Hello, world" type stuff in the past), and I've been learning alot about C programming under GNU/Linux. It's been very exciting. :) I have been using GNU/Linux since '96 (home setup is Slackware archives/ftp server, Gentoo workstation, two additional Gentoo workstations for distcc compile farm ;), Sharp Zaurus SL-C3100 handheld, MacBook Pro notebook, MacPro workstation  :) ), so I'm definitely not new to it at all, just coding for it; in fact I do have the Level 1 LPI certificate, which I received in Nov. of 2004, just to give an indication of my knowledge and ability (just new to coding C under GNU/Linux).  :)

   Anyway, if anyone can give me some clues or tips, I would really appreciate it, and perhaps if my problem is not relevant to developing CUPS filters, but rather to my lack of experience with GNU/Linux C programming in general, please provide at least a tidbit of assistance. (I'm currently a printer driver/software developer using C and the Windows API...).

   Thanks much in advance,

      Bill





More information about the cups mailing list