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

perpctl.8 (5155B)


  1. .\" perpctl.8
  2. .\" wcm, 2009.12.01 - 2013.01.07
  3. .\" ===
  4. .TH perpctl 8 "January 2013" "perp-2.07" "persistent process supervision"
  5. .de ZZ
  6. . br
  7. . ns
  8. ..
  9. .SH NAME
  10. perpctl \- runtime control utility for
  11. .BR perpd (8)
  12. services
  13. .SH SYNOPSIS
  14. .B perpctl [-hV] [-b
  15. .I basedir
  16. .B ] [-g] [-L] [-q]
  17. .I cmd sv
  18. .B [
  19. .I sv ...
  20. .B ]
  21. .SH DESCRIPTION
  22. .B perpctl
  23. sends the command specified in
  24. .I cmd
  25. to the
  26. .BR perpd (8)
  27. control interface for each service argument
  28. .IR sv .
  29. .PP
  30. The argument
  31. .I cmd
  32. may be given as a single word of any length,
  33. but only the first letter is considered.
  34. The available commands include
  35. (with mnemonic in parentheses):
  36. .PP
  37. .B A
  38. (Activate)
  39. .RS
  40. Sets the sticky bit on each
  41. .I sv
  42. service directory argument and
  43. sends SIGHUP to
  44. .BR perpd (8).
  45. The effect is to activate each
  46. .I sv
  47. service.
  48. .RE
  49. .PP
  50. .B X
  51. ([e]Xit)
  52. .RS
  53. Unsets the sticky bit on each
  54. .I sv
  55. service directory argument and
  56. sends SIGHUP to
  57. .BR perpd (8).
  58. The effect is to bring down each
  59. .I sv
  60. service and remove it
  61. from the set of services
  62. .BR perpd (8)
  63. is monitoring.
  64. .RE
  65. .PP
  66. .B d
  67. (down)
  68. .RS
  69. If the service is running,
  70. send it a sequence of SIGTERM and SIGCONT signals to bring it down.
  71. .BR perpd (8)
  72. will flag the service as wanting down:
  73. if the service stops it will not be restarted.
  74. .RE
  75. .PP
  76. .B u
  77. (up)
  78. .RS
  79. If the service is not already running, start it.
  80. .BR perpd (8)
  81. will flag the service as wanting up:
  82. if the service stops it will be restarted.
  83. .RE
  84. .PP
  85. .B o
  86. (once)
  87. .RS
  88. If the service is not already running, start it.
  89. .BR perpd (8)
  90. will flag the service to run once:
  91. if the service stops it will not be restarted.
  92. .RE
  93. .PP
  94. .B p
  95. (pause)
  96. .RS
  97. Send the service a SIGSTOP signal.
  98. Normally this suspends execution of the service.
  99. .BR perpd (8)
  100. will flag the service as paused.
  101. .RE
  102. .PP
  103. .B c
  104. (continue)
  105. .RS
  106. Send the service a SIGCONT signal.
  107. Normally a paused service will then resume execution.
  108. .BR perpd (8)
  109. will remove a pause flag on the service.
  110. .RE
  111. .PP
  112. .B a
  113. (alarm)
  114. .ZZ
  115. .B h
  116. (hup)
  117. .ZZ
  118. .B i
  119. (interrupt)
  120. .ZZ
  121. .B k
  122. (kill)
  123. .ZZ
  124. .B q
  125. (quit)
  126. .ZZ
  127. .B t
  128. (term)
  129. .ZZ
  130. .B w
  131. (winch)
  132. .ZZ
  133. .B 1
  134. (usr1)
  135. .ZZ
  136. .B 2
  137. (usr2)
  138. .RS
  139. Send the service a corresponding signal:
  140. SIGALRM, SIGHUP, SIGINT, SIGKILL, SIGQUIT, SIGTERM, SIGWINCH, SIGUSR1 or SIGUSR2.
  141. .RE
  142. .PP
  143. .B D
  144. (meta-Down)
  145. .ZZ
  146. .B U
  147. (meta-Up)
  148. .RS
  149. When given in upper-case, the
  150. .B d
  151. (down) and
  152. .B u
  153. (up) commands described above
  154. are applied to both the main and log services.
  155. .RE
  156. .PP
  157. The signal/control commands listed above
  158. are applied to an active service process
  159. running from the ``start'' target of its
  160. .BR perpetrate (5)
  161. runscript.
  162. .BR perpd (8)
  163. will otherwise ignore any of the commands described above
  164. if received while a service is resetting,
  165. except for the commands
  166. .B c
  167. (continue/SIGCONT)
  168. or
  169. .B k
  170. (kill/SIGKILL).
  171. .SH OPTIONS
  172. .TP
  173. .B \-b basedir
  174. Base directory.
  175. Sets the base directory containing the
  176. .I sv
  177. arguments.
  178. If not set,
  179. .B perpctl
  180. will look for a value set in the environmental variable PERP_BASE.
  181. If neither of these is set,
  182. .B perpctl
  183. will operate on the current working directory.
  184. .TP
  185. .B \-g
  186. Group.
  187. Apply the requested command to the process group id (pgid) of each
  188. .I sv
  189. service.
  190. Normally the signal is applied only to the single process id of the service.
  191. .BR perpd (8)
  192. runs each main and log process in its own separate process group;
  193. the
  194. .B \-g
  195. option directs
  196. .BR perpd (8)
  197. to signal all process running with the pgid of the service.
  198. May be combined with the
  199. .B \-L
  200. option to signal all processes in the process group of the logging service.
  201. .TP
  202. .B \-h
  203. Help.
  204. Print a brief usage message to stderr and exit.
  205. .TP
  206. .B \-L
  207. Logger.
  208. Apply the
  209. .I cmd
  210. argument to the active logging service found in
  211. .I sv
  212. services.
  213. By default, the
  214. .I cmd
  215. argument is applied to the main service.
  216. The
  217. .B \-L
  218. option is not allowed when using any of the meta-commands
  219. .BR D ", " U ", or " X .
  220. .TP
  221. .B \-q
  222. Quiet.
  223. Normally after successfully applying the
  224. .I cmd
  225. to each
  226. .IR sv ,
  227. .B perpctl
  228. reports a brief message to stderr.
  229. The
  230. .B \-q
  231. option may be used to suppress these messages.
  232. .TP
  233. .B \-V
  234. Version.
  235. Print the version number of the program to stderr and exit.
  236. .SH DIAGNOSTICS
  237. For each
  238. .I sv
  239. successfully processed,
  240. .B perpctl
  241. prints a line to stderr in the form:
  242. .IP
  243. .IR sv :
  244. ok
  245. .PP
  246. For each
  247. .I sv
  248. not successfully processed,
  249. .B perpctl
  250. prints a brief diagnostic to stderr and continues processing any remaining
  251. .IR sv .
  252. .SH EXIT STATUS
  253. .PP
  254. .B perpctl
  255. exits with one of the following values:
  256. .TP
  257. 0
  258. Success.
  259. The
  260. .I cmd
  261. was successfully delivered to all
  262. .I sv
  263. service arguments.
  264. .TP
  265. 100
  266. Usage error.
  267. For unknown options, missing arguments, or other command-line errors.
  268. Prints a brief diagnostic message to stderr on exit.
  269. .TP
  270. 111
  271. System error.
  272. One or more errors were encountered while processing.
  273. These may include unexpected failures of system calls,
  274. privilege and/or resource problems,
  275. or configuration errors in the base directory.
  276. A brief diagnostic message is printed to stderr for each error encountered.
  277. .SH AUTHOR
  278. Wayne Marshall, http://b0llix.net/perp/
  279. .SH SEE ALSO
  280. .nh
  281. .BR perp_intro (8),
  282. .BR perpboot (8),
  283. .BR perpd (8),
  284. .BR perpetrate (5),
  285. .BR perphup (8),
  286. .BR perpls (8),
  287. .BR perpok (8),
  288. .BR perpstat (8),
  289. .BR sissylog (8),
  290. .BR tinylog (8)
  291. .\" eof