Description
===========
Installs runit and provides the `runit_service` service resource for
managing processes (services) under runit.
This cookbook does not use runit to replace system init, nor are there
plans to do so.
For more information about runit:
* http://smarden.org/runit/
About Runit
===========
In brief, Runit is a process supervision suite. It is simple to set
up, and doesn't require complex shell scripts to be written to start
processes running as system services.
To manage a process in runit, create a "service" directory that
contains a "`run`" script. In this cookbook we refer to that directory
as the `sv_dir` (see __Attributes__ and __Resource/Provider__). That
service directory is symbolically linked into runit's own service
directory where its `runsvdir` program looks for processes to manage.
See the [runit documentation](http://smarden.org/runit/) for detailed
information on runit.
Supervised processes are analogous to services under other systems
such as sysvinit or upstart.
Requirements
============
## Platform:
* Debian/Ubuntu
* Gentoo
* RHEL
Attributes
==========
See `attributes/default.rb` for defaults generated per platform.
* `node['runit']['sv_bin']` - Full path to the `sv` binary.
* `node['runit']['chpst_bin']` - Full path to the `chpst` binary.
* `node['runit']['service_dir']` - Full path to the default "services"
directory where enabled services are linked.
* `node['runit']['sv_dir']` - Full path to the directory where
service lives, which gets linked to `service_dir`.
* `node['runit']['start']` - Command to start the runsvdir service
* `node['runit']['stop]` - Command to stop the runsvdir service
* `node['runit']['reload']` - Command to reload the runsvdir service
Recipes
=======
default
-------
The default recipe installs runit and starts `runsvdir` to supervise
the services in runit's service directory (e.g., `/etc/service`).
On RHEL family systems, it will build the runit RPM using [Ian Meyer's
runit RPM SPEC](https://github.com/imeyer/runit-rpm).
On Debian family systems, the runit packages are maintained by the
runit author, Gerrit Pape, and the recipe will use that for
installation.
On Gentoo, the runit ebuild package is installed.
Resource/Provider
=================
This cookbook has a resource, `runit_service`, for managing services
under runit. This service subclasses the Chef `service` resource.
**This resource replaces the runit_service definition. See the
CHANGELOG.md file in this cookbook for breaking change information
and any actions you may need to take to update cookbooks using
runit_service.**
## Actions:
- **enable** - enables the service, creating the required run scripts
and symlinks. This is the default action.
- **start** - starts the service with `sv start`
- **stop** - stops the service with `sv stop`
- **disable** - stops the service with `sv down` and removes the service symlink
- **restart** - restarts the service with `sv restart`
- **reload** - reloads the service with `sv force-reload`
- **once** - starts the service with `sv once`.
- **hup** - sends the `HUP` signal to the service with `sv hup`
- **cont** - sends the `CONT` signal to the service
- **term** - sends the `TERM` signal to the service
- **kill** - sends the `KILL` signal to the service
- **up** - starts the service with `sv up`
- **down** - downs the service with `sv down`
- **usr1** - sends the `USR1` signal to the service with `sv 1`
- **usr2** - sends the `USR2` signal to the service with `sv 2`
Service management actions are taken with runit's "`sv`" program.
Read the `sv(8)` [man page](http://smarden.org/runit/sv.8.html) for
more information on the `sv` program.
## Parameter Attributes
The first three parameters, `sv_dir`, `service_dir`, and `sv_bin` will
attempt to use the corresponding node attributes, and fall back to
hardcoded default values that match the settings used on Debian
platform systems.
Many of these parameters are only used in the `:enable` action.
- **sv_dir** - The base "service directory" for the services managed by
the resource. By default, this will attempt to use the
`node['runit']['sv_dir']` attribute, and falls back to `/etc/sv`.
- **service_dir** - The directory where services are symlinked to be
supervised by `runsvdir`. By default, this will attempt to use the
`node['runit']['service_dir']` attribute, and falls back to
`/etc/service`.
- **sv_bin** - The path to the `sv` program binary. This will attempt
to use the `node['runit']['sv_bin']` attribute, and falls back to
`/usr/bin/sv`.
- **service_name** - *Name attribute*. The name of the service. This
will be used in the directory of the managed service in the
`sv_dir` and `service_dir`.
- **sv_templates** - If true, the `:enable` action will create the
service directory with the appropriate templates. Default is
`true`. Set this to `false` if the service has a package that
provides its own service directory. See __Usage__ examples.
- **options** - Options passed as variables to templates, for
compatibility with legacy runit service definition. Default is an
empty hash.
- **env** - A hash of environment variables with their values as content
used in the service's `env` directory. Default is an empty hash.
- **log** - Whether to start the service's logger with svlogd, requires
a template `sv-service_name-log-run.erb` to configure the log's run
script. Default is true.
- **default_logger** - Whether a default `log/run` script should be set
up. If true, the default content of the run script will use
`svlogd` to write logs to `/var/log/service_name`. Default is false.
- **cookbook** - A cookbook where templates are located instead of
where the resource is used. Applies for all the templates in the
`enable` action.
- **finish** - whether the service has a finish script, requires a
template `sv-service_name-finish.erb`
- **control** - An array of signals to customize control of the service,
see [runsv man page](http://smarden.org/runit/runsv.8.html) on how
to use this. This requires that each template be created with the
name `sv-service_name-signal.erb`.
- **owner** - user that should own the templates created to enable the
service
- **group** - group that should own the templates created to enable the
service
- **run_template_name** - alternate filename of the run run script to
use replacing `service_name`.
- **log_template_name** - alternate filename of the log run script to
use replacing `service_name`.
- **finish_script_template_name** - alternate filename of the finish
script to use, replacing `service_name`.
- **control_template_names** - a hash of control signals (see *control*
above) and their alternate template name(s) replacing
`service_name`.
- **status_command** - The command used to check the status of the
service to see if it is enabled/running (if it's running, it's
enabled). This hardcodes the location of the sv program to
`/usr/bin/sv` due to the aforementioned cookbook load order.
Unlike previous versions of the cookbook using the `runit_service`
definition, the `runit_service` resource can be notified. See
__Usage__ examples below.
Usage
=====
To get runit installed on supported platforms, use `recipe[runit]`.
Once it is installed, use the `runit_service` resource to set up
services to be managed by runit.
In order to use the `runit_service` resource in your cookbook(s), each
service managed will also need to have `sv-service_name-run.erb` and
`sv-service_name-log-run.erb` templates created. If the `log`
parameter is false, the log run script isn't created. If the `log`
parameter is true, and `default_logger` is also true, the log run
script will be created with the default content:
#!/bin/sh
exec svlogd -tt /var/log/service_name
Examples
--------
These are example use cases of the `runit_service` resource described
above. There are others in the `runit_test` cookbook t
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
The_official_online_compendium_for_Mining_the_Soci_ (250个子文件)
virtualenv.bats 469B
exert.bats 428B
source.bats 212B
Berksfile 179B
Berksfile 141B
Berksfile 81B
enron.mbox.json.bz2 25.65MB
apt-proxy-v2.conf 1KB
CONTRIBUTING 1KB
CONTRIBUTING 1KB
style.css 2KB
empty 0B
empty 0B
acng.conf.erb 13KB
acng.conf.erb 13KB
acng.conf.erb 8KB
init.d.erb 2KB
yum-rhel6.conf.erb 1KB
yum-rhel5.conf.erb 900B
repo.erb 845B
runit-start.sh.erb 697B
sv-finisher-finish.erb 192B
sv-yerba-matte-finish.erb 183B
sv-ipython-run.erb 176B
01proxy.erb 90B
sv-template-options-run.erb 78B
sv-control-signals-u.erb 70B
sv-runsvdir-floyd-run.erb 68B
sv-other-cookbook-templates-run.erb 43B
sv-env-files-run.erb 36B
sv-control-signals-run.erb 36B
sv-default-svlog-run.erb 36B
sv-yerba-run.erb 36B
sv-plain-defaults-run.erb 36B
sv-floyds-app-run.erb 36B
sv-no-svlog-run.erb 36B
sv-exist-disabled-run.erb 36B
sv-calabash-run.erb 36B
sv-finisher-run.erb 36B
sv-downed-service-run.erb 36B
sv-exist-disabled-log-run.erb 33B
sv-control-signals-log-run.erb 33B
sv-env-files-log-run.erb 33B
sv-floyds-app-log-run.erb 33B
sv-finisher-log-run.erb 33B
sv-yerba-matte-log-run.erb 33B
sv-template-options-log-run.erb 33B
sv-plain-defaults-log-run.erb 33B
sv-runsvdir-floyd-log-run.erb 33B
sv-downed-service-log-run.erb 33B
sv-other-cookbook-templates-log-run.erb 32B
Gemfile 485B
Gemfile 113B
.gitignore 176B
.gitignore 136B
.gitignore 129B
.gitignore 116B
.gitignore 116B
__What do Tim O'Reilly, Lady Gaga, and Marissa Mayer all have in common.html 367KB
Chapter 9 - Twitter Cookbook.html 334KB
__Chapter 1 - Mining Twitter (Full-Text Sampler).html 328KB
Chapter 3 - Mining LinkedIn.html 315KB
Chapter 6 - Mining Mailboxes.html 289KB
Chapter 4 - Mining Google+.html 268KB
Chapter 5 - Mining Web Pages.html 263KB
Chapter 7 - Mining GitHub.html 257KB
_Appendix C - Python & IPython Notebook Tips.html 249KB
Chapter 2 - Mining Facebook.html 242KB
Chapter 1 - Mining Twitter.html 231KB
_Appendix B - OAuth Primer.html 225KB
Chapter 8 - Mining the Semantically Marked-Up Web.html 214KB
_Appendix A - Virtual Machine Experience.html 210KB
Chapter 0 - Preface.html 197KB
matrix.html 5KB
cartogram.html 3KB
force.html 2KB
force.html 2KB
node_link_tree.html 2KB
dendogram.html 1KB
tree_widget.html 1KB
__Chapter 1 - Mining Twitter (Full-Text Sampler).ipynb 142KB
__What do Tim O'Reilly, Lady Gaga, and Marissa Mayer all have in common.ipynb 130KB
__Understanding the Reaction to Amazon Prime Air.ipynb 97KB
Chapter 9 - Twitter Cookbook.ipynb 58KB
Chapter 3 - Mining LinkedIn.ipynb 43KB
Chapter 6 - Mining Mailboxes.ipynb 37KB
_Appendix C - Python & IPython Notebook Tips.ipynb 34KB
Chapter 4 - Mining Google+.ipynb 26KB
Chapter 7 - Mining GitHub.ipynb 25KB
Chapter 5 - Mining Web Pages.ipynb 25KB
Chapter 2 - Mining Facebook.ipynb 22KB
_Appendix B - OAuth Primer.ipynb 20KB
_Appendix A - Virtual Machine Experience.ipynb 19KB
Chapter 1 - Mining Twitter.ipynb 19KB
Chapter 8 - Mining the Semantically Marked-Up Web.ipynb 9KB
Chapter 0 - Preface.ipynb 7KB
MentionSomeoneImportantForYou.json 407KB
metadata.json 10KB
us-states-centroids-simple.json 2KB
states-codes.json 1KB
共 250 条
- 1
- 2
- 3
资源评论
好家伙VCC
- 粉丝: 2304
- 资源: 9142
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 纯真IP库,用于ip查询地址使用的数据库文件
- 基于javaweb的动漫网站管理系统毕业设计论文.doc
- 废物垃圾检测28-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 探索CSDN博客数据:使用Python爬虫技术
- 基于tensorflow和cnn做的图像识别,对四种花卉进行了分类项目源代码+使用说明,可识别:玫瑰花、郁金香、蒲公英、向日葵
- 基于Java的电影订票网站的设计与开发毕业设计论文.doc
- ODrive 固件 0.5.6
- 停电自动关机程序.EXE
- RabbitMQ 的7种工作模式
- 基于java的大学生二手书在线买卖系统论文.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功