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

runtools_intro.8 (4695B)


  1. .\" runtools_intro.8
  2. .\" wcm, 2009.12.15 - 2012.01.04
  3. .\" ===
  4. .TH runtools_intro 8 "January 2013" "runtools-2.07" "runtools"
  5. .SH NAME
  6. runtools_intro \- overview of the
  7. .B runtools
  8. utilities
  9. .SH DESCRIPTION
  10. The
  11. .B runtools
  12. package provides a set of utilities for configuring and constraining
  13. the process execution environment of other programs.
  14. Most of the utilities exec into the process environment they create.
  15. That is, they are designed to replace themselves with some other program.
  16. A few of the utilities act as lightweight supervisors,
  17. remaining resident themselves while monitoring some other process or processes.
  18. The
  19. .B runtools
  20. utilities include:
  21. .TP
  22. .BR runargs (8)
  23. Runs a program with arguments specified in an
  24. .IR argfile .
  25. .TP
  26. .BR runargv0 (8)
  27. Runs a program with an alias in place of the 0th argument.
  28. .TP
  29. .BR runchoom (8)
  30. Runs a program with linux ``oom killer'' abatement.
  31. .TP
  32. .BR rundetach (8)
  33. Runs a program in the background,
  34. detached from the controlling terminal.
  35. .TP
  36. .BR rundeux (8)
  37. Runs and supervises a program with an associated logger.
  38. .TP
  39. .BR runenv (8)
  40. Runs a program with an environment defined in either an
  41. .I envfile
  42. or an
  43. .IR envdir .
  44. .TP
  45. .BR runfile (8)
  46. Runs a program described in an
  47. .IR argvfile .
  48. .TP
  49. .BR runlimit (8)
  50. Runs a program with modified resource limits.
  51. .TP
  52. .BR runlock (8)
  53. Runs a program with an associated
  54. .IR lockfile ,
  55. optionally containing the pid of the process.
  56. .TP
  57. .BR runpause (8)
  58. Runs a program after waiting some delay or receiving a signal.
  59. .TP
  60. .BR runsession (8)
  61. Runs a program in a new session and process group.
  62. .TP
  63. .BR runtool (8)
  64. Multipurpose utility for running a program in a configured process environment,
  65. combining many of the functions of other
  66. .B runtools
  67. within a single executable.
  68. .TP
  69. .BR runtrap (8)
  70. Runs and supervises a program with an associated signal trapper.
  71. .TP
  72. .BR runuid (8)
  73. Runs a program with specific user and group permissions.
  74. .SH EXEC CHAINS
  75. The
  76. .B runtools
  77. utilities are designed primarily for use within the runscripts of service supervisors,
  78. such as
  79. .BR perpd (8)
  80. and
  81. .BR daemontools .
  82. In this case,
  83. they will normally be used to define and constrain such things as resources,
  84. privileges,
  85. environmental variables,
  86. file descriptors,
  87. etc.
  88. They may be used to provide carefully regulated execution environments for
  89. long-running programs,
  90. for security and resource optimization.
  91. .PP
  92. Most of the utilities in the
  93. .B runtools
  94. package are very small programs designed to do one simple thing.
  95. Because the effects of multiple
  96. .B runtools
  97. are often required,
  98. it is customary to use whatever
  99. .B runtools
  100. are needed in an ``exec chain''.
  101. An exec chain is a sequence of
  102. .B runtools
  103. commands, one calling another,
  104. often in a specific order,
  105. with the final command execing into the actual program intended.
  106. The following
  107. .BR perpetrate (5)
  108. snippet shows an example in
  109. .BR sh (1)
  110. syntax:
  111. .PP
  112. .RS
  113. .nf
  114. if test ${1} = 'start' ; then
  115. exec runenv -i ./envfile \\
  116. runlimit -c 0 -f 2000000 -m 30000000 \\
  117. runuid fooman \\
  118. /usr/sbin/foo -f
  119. fi
  120. .fi
  121. .RE
  122. .PP
  123. In the example above,
  124. the program
  125. .I /usr/sbin/foo
  126. is ultimately desired as the long-running process.
  127. An exec chain is used to:
  128. .IP \(bu 4
  129. define the environment for ``foo'' with
  130. .BR runenv (8)
  131. .IP \(bu 4
  132. constrain corefiles, file size, and memory usage with
  133. .BR runlimit (8)
  134. .IP \(bu 4
  135. drop privilege to the user account ``fooman'' with
  136. .BR runuid (8)
  137. .PP
  138. Each of the
  139. .B runtools
  140. programs execs into the next,
  141. until finally the
  142. .BR runuid (8)
  143. utility execs into
  144. .IR /usr/sbin/foo .
  145. .SH EXIT STATUS
  146. The
  147. .B runtools
  148. that exec themselves into another
  149. .I program
  150. will exit with the following values:
  151. .TP
  152. 0
  153. .I program
  154. was invoked and completed successfully.
  155. In this case,
  156. the exit code is returned by the
  157. .IR program ,
  158. rather than by the
  159. .B runtools
  160. program itself.
  161. .TP
  162. 100
  163. The
  164. .B runtools
  165. program failed because of a usage error,
  166. such as an invalid command\-line option or argument.
  167. In this case,
  168. the
  169. .B runtools
  170. program prints a brief error message and usage help to stderr on exit.
  171. .TP
  172. 111
  173. The
  174. .B runtools
  175. program failed due to some system or resource error.
  176. In this case,
  177. the
  178. .B runtools
  179. program prints a brief diagnostic message to stderr on exit.
  180. .TP
  181. 1\-127
  182. .I program
  183. was invoked by the
  184. .B runtools
  185. utility and then terminated with its own non-zero exit status.
  186. .SH AUTHOR
  187. Wayne Marshall, http://b0llix.net/perp/
  188. .SH SEE ALSO
  189. .nh
  190. .BR runargs (8),
  191. .BR runargv0 (8),
  192. .BR runchoom (8),
  193. .BR rundetach (8),
  194. .BR rundeux (8),
  195. .BR runenv (8),
  196. .BR runfile (8),
  197. .BR runlimit (8),
  198. .BR runlock (8),
  199. .BR runpause (8),
  200. .BR runsession (8),
  201. .BR runtool (8),
  202. .BR runtrap (8),
  203. .BR runuid (8),
  204. .BR perp_intro (8),
  205. .BR perpd (8),
  206. .BR perpetrate (5)
  207. .\" EOF