logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

runpause.8 (2613B)


  1. .\" runpause.8
  2. .\" wcm, 2009.12.11 - 2011.03.11
  3. .\" ===
  4. .TH runpause 8 "January 2013" "runtools-2.07" "runtools"
  5. .SH NAME
  6. runpause \- run a program after a specified delay
  7. .SH SYNOPSIS
  8. .B runpause [\-hV] [\-L
  9. .I label
  10. .B ]
  11. .I secs program
  12. .B [
  13. .I args ...
  14. .B ]
  15. .SH DESCRIPTION
  16. .B runpause
  17. sleeps for
  18. .I secs
  19. (or until interrupted by a signal),
  20. and then runs
  21. .I program
  22. with any arguments given in
  23. .IR args .
  24. .PP
  25. If
  26. .I secs
  27. is 0,
  28. .B runpause
  29. will pause forever,
  30. or until interrupted by a signal.
  31. .PP
  32. If
  33. .I program
  34. does not contain a ``/'' slash character,
  35. .B runpause
  36. will perform a shell-like search for the executable using the
  37. .B PATH
  38. variable in the current environment.
  39. .SH OPTIONS
  40. .TP
  41. .B \-h
  42. Help.
  43. Print a brief usage message to stderr and exit.
  44. .TP
  45. .B \-L label
  46. Label.
  47. May be used to provide
  48. .I label
  49. as a distinctive command-line marker for an instance of
  50. .BR runpause ,
  51. such as for reference in
  52. .BR ps (1)
  53. listings.
  54. Otherwise, this option has no effect.
  55. .TP
  56. .B \-V
  57. Version.
  58. Print the version number to stderr and exit.
  59. .SH EXAMPLES
  60. The
  61. .B runpause
  62. utility may be used to hack a
  63. .BR perpetrate (5)
  64. service out of what would normally be a system initialization:
  65. .PP
  66. .RS
  67. .nf
  68. #!/bin/sh
  69. exec 2>&1
  70. if test ${1} = 'start' ; then
  71. # startup network:
  72. echo "starting network ..."
  73. ifconfig ...
  74. # maintain persistent state for this service:
  75. exec runpause -L network 0 /bin/true
  76. fi
  77. if test ${1} = 'reset' ; then
  78. # take down network and whatever depends on it:
  79. echo "resetting network ..."
  80. ...
  81. fi
  82. ### EOF
  83. .fi
  84. .RE
  85. .PP
  86. The author does not recommend this sort of thing
  87. and will never mention it again.
  88. .SH EXIT STATUS
  89. .B runpause
  90. exits with one of the following values:
  91. .TP
  92. 0
  93. .I program
  94. was invoked and completed successfully.
  95. In this case,
  96. the exit code is returned by the
  97. .IR program ,
  98. rather than by
  99. .B runpause
  100. itself.
  101. .TP
  102. 100
  103. .B runpause
  104. failed because of a usage error,
  105. such as an invalid command\-line option or argument.
  106. In this case,
  107. .B runpause
  108. prints a brief error message and usage help to stderr on exit.
  109. .TP
  110. 111
  111. .B runpause
  112. failed due to some system or resource error.
  113. In this case,
  114. .B runpause
  115. prints a brief diagnostic message to stderr on exit.
  116. .TP
  117. 1\-127
  118. .I program
  119. was invoked and failed with its own non-zero exit status.
  120. .SH AUTHOR
  121. Wayne Marshall, http://b0llix.net/perp/
  122. .SH SEE ALSO
  123. .nh
  124. .BR runtools_intro (8),
  125. .BR runargs (8),
  126. .BR runargv0 (8),
  127. .BR runchoom (8),
  128. .BR rundetach (8),
  129. .BR rundeux (8),
  130. .BR runenv (8),
  131. .BR runfile (8),
  132. .BR runlimit (8),
  133. .BR runlock (8),
  134. .BR runsession (8),
  135. .BR runtool (8),
  136. .BR runtrap (8),
  137. .BR runuid (8),
  138. .BR perpd (8),
  139. .BR perpetrate (5)
  140. .\" EOF