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

runlimit.8 (4640B)


  1. .\" runlimit.8
  2. .\" wcm, 2009.12.14 - 2011.02.08
  3. .\" ===
  4. .TH runlimit 8 "January 2013" "runtools-2.07" "runtools"
  5. .SH NAME
  6. runlimit \- run a program with new resource limits
  7. .SH SYNOPSIS
  8. .B runlimit [\-hV] [
  9. .I opts
  10. .B ]
  11. .I program
  12. .B [
  13. .I args ...
  14. .B ]
  15. .SH DESCRIPTION
  16. .B runlimit
  17. sets up an environment with new resource limits as given by
  18. .IR opts ,
  19. then runs
  20. .I program
  21. with any additional
  22. .IR args .
  23. .PP
  24. If
  25. .I program
  26. does not contain a ``/'' slash character,
  27. .B runlimit
  28. will perform a shell-like search for the executable using the
  29. .B PATH
  30. variable in the current environment.
  31. .SH OPTIONS
  32. For each of the following resource limit options in
  33. .IR opts ,
  34. .B runlimit
  35. calls
  36. .BR setrlimit (2)
  37. to setup the corresponding soft resource limit.
  38. Normally the argument to each option is a positive decimal integer.
  39. An argument of
  40. .RB ` = '
  41. or
  42. .RB `^'
  43. may be given to set the soft limit equal to the current hard limit.
  44. Any resource limit specified that is greater than its hard limit
  45. is truncated to the hard limit.
  46. .TP
  47. .B \-E
  48. Environment.
  49. Resource parameters are scanned from the current environment in the form
  50. .IR r = v ,
  51. where
  52. .I r
  53. is any RLIMIT_* resource name as defined for
  54. .BR getrlimit (2)
  55. and described below,
  56. and
  57. .I v
  58. is the value used to set the corresponding resource limit.
  59. The
  60. .B \-E
  61. option may be combined with
  62. .B \-F
  63. or other options.
  64. Any resource limit set with a command-line option,
  65. or read from a file with the
  66. .B \-F
  67. option,
  68. takes precedence over the environment.
  69. .TP
  70. .B \-F file
  71. File-defined.
  72. Resource limits are taken from
  73. .IR file ,
  74. a plain-text file with one or more non-empty lines of the form
  75. .IR r = v ,
  76. where
  77. .I r
  78. is any RLIMIT_* resource name as defined for
  79. .BR getrlimit (2)
  80. and described below,
  81. and
  82. .I v
  83. is the value used to set the corresponding resource limit.
  84. Empty lines and lines beginning with `#' are ignored.
  85. Leading and trailing whitespace is trimmed from both
  86. .I r
  87. and
  88. .IR v .
  89. The
  90. .B \-F
  91. option may be combined with
  92. .B \-E
  93. or other options.
  94. Any resource limit set with a command-line option
  95. takes precedence over a file-defined limit.
  96. .TP
  97. .B \-a availmem
  98. Total available memory (in bytes).
  99. Resource parameter RLIMIT_AS and/or RLIMIT_VMEM (used synonymously).
  100. .TP
  101. .B \-c coresize
  102. Maximum size of a core file (in bytes).
  103. Resource parameter RLIMIT_CORE.
  104. An argument of 0
  105. will suppress core files.
  106. .TP
  107. .B \-d databytes
  108. Maximum data segment (in bytes).
  109. Resource parameter RLIMIT_DATA.
  110. .TP
  111. .B \-f filesize
  112. Maximum size for any file that may be created (in bytes).
  113. Resource parameter RLIMIT_FSIZE.
  114. .TP
  115. .B \-l lockbytes
  116. Maximum memory that may be locked by
  117. .BR mlock (2)
  118. (in bytes).
  119. Resource parameter RLIMIT_MEMLOCK.
  120. .TP
  121. .B \-m bytes
  122. Combines the options
  123. .B \-a \-d \-l
  124. and
  125. .B \-s
  126. (in bytes).
  127. .TP
  128. .B \-o files
  129. Maximum number of open files (in number of files).
  130. Resource parameter RLIMIT_NOFILE.
  131. .TP
  132. .B \-p processes
  133. Maximum number of processes per uid (in number of processes).
  134. Resource parameter RLIMIT_NPROC.
  135. .TP
  136. .B \-r rssbytes
  137. Maximum resident memory (in bytes).
  138. Resource parameter RLIMIT_RSS.
  139. .TP
  140. .B \-s stackbytes
  141. Maximum stack size (in bytes).
  142. Resource parameter RLIMIT_STACK.
  143. .B \-t secs
  144. Maximum CPU time per process (in seconds).
  145. Resource parameter RLIMIT_CPU.
  146. .PP
  147. .B runlimit
  148. also provides the following standard
  149. .BR runtools_intro (8)
  150. options:
  151. .TP
  152. .B \-h
  153. Help.
  154. Print a brief usage message to stderr and exit.
  155. .TP
  156. .B \-V
  157. Version.
  158. Print the version number to stderr and exit.
  159. .SH EXIT STATUS
  160. .B runlimit
  161. exits with one of the following values:
  162. .TP
  163. 0
  164. .I program
  165. was invoked and completed successfully.
  166. In this case,
  167. the exit code is returned by the
  168. .IR program ,
  169. rather than by
  170. .B runlimit
  171. itself.
  172. .TP
  173. 100
  174. .B runlimit
  175. failed because of a usage error,
  176. such as an invalid command\-line option or argument.
  177. In this case,
  178. .B runlimit
  179. prints a brief error message and usage help to stderr on exit.
  180. .TP
  181. 111
  182. .B runlimit
  183. failed due to some system or resource error.
  184. In this case,
  185. .B runlimit
  186. prints a brief diagnostic message to stderr on exit.
  187. .TP
  188. 1\-127
  189. .I program
  190. was invoked and failed with its own non-zero exit status.
  191. .SH CAVEATS
  192. Not all resource limits are supported on all platforms.
  193. .PP
  194. (The source distribution includes a
  195. .BR catlimits (8)
  196. utility that will show the current resource limits,
  197. indicating any that are not supported on the host platform.)
  198. .SH AUTHOR
  199. Wayne Marshall, http://b0llix.net/perp/
  200. .SH SEE ALSO
  201. .nh
  202. .BR setrlimit (2),
  203. .BR runtools_intro (8),
  204. .BR runargs (8),
  205. .BR runargv0 (8),
  206. .BR runchoom (8),
  207. .BR rundetach (8),
  208. .BR rundeux (8),
  209. .BR runenv (8),
  210. .BR runfile (8),
  211. .BR runlock (8),
  212. .BR runpause (8),
  213. .BR runsession (8),
  214. .BR runtool (8),
  215. .BR runtrap (8),
  216. .BR runuid (8)
  217. .\" EOF