[torqueusers] qmgr truncates output in batch mode

Jan Nilsson jan.jn.nilsson at consultant.volvo.com
Thu Jun 11 08:58:30 MDT 2009


Hi,

We have experienced some problems using "qmgr -c <cmd>" in scripts.
The output seemed truncated or the qmgr was crashing prematurely.

When analyzing it in depth - we found that it seems to be connected to
"qmgr" using the readline() utility.

My colleague found that adding a fflush(NULL) before exiting solved the
problem.

Here's the fix that was applied:

----------
# diff -Naur cmds*/qmgr.c
--- cmds.old/qmgr.c     2009-06-11 16:04:47.000000000 +0200
+++ cmds/qmgr.c 2009-06-11 16:22:08.000000000 +0200
@@ -313,6 +313,7 @@
                   type,
                   name,
                   attribs);
+       fflush(NULL);   /* peter h IPSec 2009 * fix truncated output */

        if (aopt && errflg)
          clean_up_and_exit(2);
----------

I'm not sure if this is the best solution - but it fixed the problem.
Please comment - and use at your own discretion.

I'll try to make an bugzilla report out ASAP. Wish me luck :-)

Regards,
Jan N
Sysadm HPC
Volvo Technology





More information about the torqueusers mailing list