chiark / gitweb /
Rename `timeout' to `mtimeout' to prevent conflict with GNU Coreutils.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 31 Aug 2011 13:44:19 +0000 (14:44 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 31 Aug 2011 13:44:19 +0000 (14:44 +0100)
The Coreutils version is broken: it places itself in a new process group
and its child inherits the new process group (though this isn't
documented anywhere).  This stops interactive signals from working
properly.

Makefile.am
debian/control
debian/inst
mtimeout.1 [moved from timeout.1 with 92% similarity]
mtimeout.c [moved from timeout.c with 100% similarity]

index dce864aa86584a688e3911b439bbded9e1ecec36..57162e8224e9ae0937f5771793f28e66f00f8923 100644 (file)
@@ -68,12 +68,12 @@ pause_LDADD          = $(mLib_LIBS) $(MATH_LIBS)
 dist_man_MANS          += pause.1
 endif
 
-## timeout
+## mtimeout
 if HAVE_MLIB
-bin_PROGRAMS           += timeout
-timeout_SOURCES                 = timeout.c
-timeout_LDADD           = $(mLib_LIBS) $(MATH_LIBS)
-dist_man_MANS          += timeout.1
+bin_PROGRAMS           += mtimeout
+mtimeout_SOURCES        = mtimeout.c
+mtimeout_LDADD          = $(mLib_LIBS) $(MATH_LIBS)
+dist_man_MANS          += mtimeout.1
 endif
 
 ## stamp
index ca716521459cef7a1e985df00a5ee02eb5b11de5..359f211c503e7b473aaec4bfe7e8782c85a6cf42 100644 (file)
@@ -19,7 +19,7 @@ Depends:
        shadowfix,
        zz,
        gorp,
-       timeout,
+       mtimeout,
        splitconf,
        xtitle,
        pause,
@@ -43,7 +43,7 @@ Section: utils
 Depends: ${shlibs:Depends}, python (>= 2.4), python-cdb
 Description: Simple utilities for messing with CDB files.
 
-Package: timeout
+Package: mtimeout
 Architecture: any
 Section: utils
 Depends: ${shlibs:Depends}
index 2b8ab18424f8660e35f10bf15fd897750db69867..2e1da69fa946c93e50b7d5e10fa151f78911a9e7 100644 (file)
@@ -23,8 +23,8 @@ if-mtu if-mtu /usr/bin
 if-mtu.1 if-mtu /usr/share/man/man1
 inplace inplace /usr/bin
 inplace.1 inplace /usr/share/man/man1
-timeout timeout /usr/bin
-timeout.1 timeout /usr/share/man/man1
+mtimeout mtimeout /usr/bin
+mtimeout.1 mtimeout /usr/share/man/man1
 locking locking /usr/bin
 locking.1 locking /usr/share/man/man1
 not nsict-mail /usr/bin
similarity index 92%
rename from timeout.1
rename to mtimeout.1
index 9d2c815172e5566cfc8d2b3e84b8aac216562bcf..c696f93c376a25db0ef09bfb5fb7b3a28530e388 100644 (file)
--- a/timeout.1
@@ -1,9 +1,9 @@
-.TH "timeout" 1 "5 June 2011" "Mark Wooding" "Toys"
+.TH "mtimeout" 1 "5 June 2011" "Mark Wooding" "Toys"
 .SH NAME
-timeout \- run a program for at most a given amount of time
+mtimeout \- run a program for at most a given amount of time
 .
 .SH SYNOPSIS
-.B timeout
+.B mtimeout
 .RB [ \-s
 .IR signal ]
 .I seconds
@@ -12,19 +12,19 @@ timeout \- run a program for at most a given amount of time
 .
 .SH DESCRIPTION
 The
-.B timeout
+.B mtimeout
 command runs a specified program for at most a given number of
 .IR seconds .
 .PP
 It works by running the given command as a separate process group.  It
 then waits either for the top-level process (only) to exit, or for the
 timeout to expire, whichever happens first.  If the process exits, then
-.B timeout
+.B mtimeout
 exits too, setting its exit status to match.  Any other processes which
 may have been started are left unmolested.
 .PP
 On the other hand, if the timeout goes off, then
-.B timeout
+.B mtimeout
 sends its child process group the specified signal, by default
 .BR SIGTERM ,
 though you can choose a different one with the
@@ -34,7 +34,7 @@ hasn't exited, it sends
 .B SIGKILL
 to the process group and waits a further five seconds.  If the child
 still hasn't exited in this time, then
-.B timeout
+.B mtimeout
 gives up and exits.
 .PP
 The following command-line options are recognized.
@@ -61,29 +61,29 @@ or by name (e.g.,
 .BR KILL ).
 .PP
 The
-.B timeout
+.B mtimeout
 program sets its exit status as follows.
 .TP
 0\(em127
 The child process ran to completion within the given time:
-.BR timeout 's
+.BR mtimeout 's
 exit status is the same as that of the child process.
 .TP
 128
 The child process exited in a way which
-.B timeout
+.B mtimeout
 could not interpret.
 .TP
 129\(em250
 The child process was killed by a signal: the exit status is 128 higher
 than the signal number.  If
-.B timeout
+.B mtimeout
 had to kill the child because it took too long, then its exit status
 will be like this.
 .TP
 251
 The child took too long and couldn't be killed:
-.B timeout
+.B mtimeout
 gave up waiting.
 .TP
 252
@@ -92,13 +92,13 @@ standard error.
 .TP
 253
 The
-.B timeout
+.B mtimeout
 program couldn't parse the arguments provided to it: an error message
 was written to standard error.
 .TP
 254
 A system call made by
-.B timeout
+.B mtimeout
 failed unexpectedly: an error message was written to standard error.
 .TP
 255
@@ -106,7 +106,7 @@ Not used.
 .
 .SH BUGS
 Because
-.B timeout
+.B mtimeout
 works by running its child process in a separate process group, it
 interacts oddly with interactive shells.  If the child process group
 attempts to do terminal I/O (particularly reading from a terminal) then
@@ -114,7 +114,7 @@ it may be sent signals to suspend it.  This may or may not make matters
 worse.
 .PP
 The
-.B timeout
+.B mtimeout
 program makes an effort to propagate interesting signals to its child
 process group.  Currently, it propagates
 .BR SIGTSTP ,
@@ -128,7 +128,7 @@ of the current signals from it, but I might add some; or I might add an
 option to control this list.
 .PP
 If you suspend
-.B timeout
+.B mtimeout
 and its child process group, the timer continues running anyway.  (I'm
 not quite sure whether this is the right behaviour.)
 .PP
@@ -136,7 +136,7 @@ Nested timeouts don't work in a useful way if the outer timeout expires
 earlier than the inner one.  Since
 .B SIGTERM
 isn't propagated (currently, at least), the inner
-.B timeout
+.B mtimeout
 is killed by the outer one, and loses control of its child process
 group.  You could possibly work around this by sending
 .B SIGQUIT
similarity index 100%
rename from timeout.c
rename to mtimeout.c