[torqueusers] suppressing output using /dev/null causes null
to be removed
Garrick Staples
garrick at usc.edu
Mon Nov 26 15:12:43 MST 2007
On Mon, Nov 26, 2007 at 01:30:56PM -0800, Garrick Staples alleged:
> On Mon, Nov 26, 2007 at 11:08:32AM -0800, Michael Gutteridge alleged:
> >
> > I have a user who was trying to suppress all output by specifying
> > "-o /dev/null -e /dev/null" when submitting using qsub.
> >
> > This led to an interesting situation. The queue he is using is
> > preempt-able, and it appears that when a job is preempted, /dev/null is
> > removed. I was able to reproduce this by submitting a job with output
> > and error directed to /dev/null then using "qrerun" to re-queue the job.
> >
> > This doesn't happen when the job is allowed to run to completion or when
> > removed with qdel or stopped with qsig. Re-queuing seems to be the only
> > circumstance where this happens. /dev/null appears to be the only file
> > where this works (e.g. specifying /etc/hosts or similar doesn't seem to
> > cause the file to be removed- bit of a relief there).
> >
> > So, two part question:
> > 1. What's the best way to discard output and error completely?
> > 2. Is this behavior fixed in a later release and I just missed it?
> >
> > Thanks all...
>
> I just replicated this bug on 2.1.9 and current trunk. Doh!
>
> Give me a bit to figure this out.
Fixes are checked into 2.1-fixes, 2.2-fixes, and trunk. The patch is simple enough.
Index: src/resmom/requests.c
===================================================================
--- src/resmom/requests.c (revision 1657)
+++ src/resmom/requests.c (working copy)
@@ -595,6 +595,11 @@
filename = std_file_name(pjob,which,&amt); /* amt is place holder */
+ if (strcmp(filename,"/dev/null") == 0)
+ {
+ return(0);
+ }
+
fds = open(filename,O_RDONLY,0);
if (fds < 0)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20071126/9ebc4553/attachment.bin
More information about the torqueusers
mailing list