From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:master commit in: /
Date: Mon, 8 Jan 2018 21:34:22 +0000 (UTC) [thread overview]
Message-ID: <1515447183.92cfa0e543d380ab290d06e98e2fef1b283349fe.williamh@OpenRC> (raw)
commit: 92cfa0e543d380ab290d06e98e2fef1b283349fe
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Jan 8 21:33:03 2018 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Jan 8 21:33:03 2018 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=92cfa0e5
service-script-guide.md: formatting changes
Add a title, adjust the headings and update the example that referred to
"net.lo" to refer to "loopback".
service-script-guide.md | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/service-script-guide.md b/service-script-guide.md
index 5806b808..668d05d4 100644
--- a/service-script-guide.md
+++ b/service-script-guide.md
@@ -1,4 +1,6 @@
-This document is aimed at upstream and distribution developers who
+# OpenRC Service Script Writing Guide
+
+This document is aimed at developers or packagers who
write OpenRC service scripts, either for their own projects, or for
the packages they maintain. It contains advice, suggestions, tips,
tricks, hints, and counsel; cautions, warnings, heads-ups,
@@ -11,7 +13,7 @@ don't consider anything exotic, and assume that you will use
start-stop-daemon to manage a fairly typical long-running UNIX
process.
-# Don't write your own start/stop functions
+## Don't write your own start/stop functions
OpenRC is capable of stopping and starting most daemons based on the
information that you give it. For a well-behaved daemon that
@@ -113,7 +115,7 @@ To recap, in order of preference:
to disable the daemon's PID file (or, to write it straight into the
garbage), then do that, and use `command_background=true`.
-# Reloading your daemon's configuration
+## Reloading your daemon's configuration
Many daemons will reload their configuration files in response to a
signal. Suppose your daemon will reload its configuration in response
@@ -139,7 +141,7 @@ reload() {
}
```
-# Don't restart/reload with a broken config
+## Don't restart/reload with a broken config
Often, users will start a daemon, make some configuration change, and
then attempt to restart the daemon. If the recent configuration change
@@ -187,7 +189,7 @@ reload() {
}
```
-# PID files should be writable only by root
+## PID files should be writable only by root
PID files must be writable only by *root*, which means additionally
that they must live in a *root*-owned directory.
@@ -239,7 +241,7 @@ A decent example of this is the [Nagios core service
script](https://github.com/NagiosEnterprises/nagioscore/blob/master/openrc-init.in),
where the full path to the PID file is specified at build-time.
-# Don't let the user control the PID file location
+## Don't let the user control the PID file location
It's usually a mistake to let the end user control the PID file
location through a conf.d variable, for a few reasons:
@@ -267,7 +269,7 @@ pidfile="/run/${RC_SVCNAME}.pid"
guarantees that your PID file has a unique name.
-# Upstream your service scripts (for distribution developers)
+## Upstream your service scripts (for packagers)
The ideal place for an OpenRC service script is **upstream**. Much like
systemd services, a well-crafted OpenRC service script should be
@@ -292,7 +294,7 @@ service script in your own distribution's repository, then you have to
keep the command path and package synchronized yourself, and that's no
fun.
-# Be wary of "need net" dependencies
+## Be wary of "need net" dependencies
There are two things you need to know about "need net" dependencies:
@@ -310,7 +312,7 @@ interface. We'll consider the two most common users of "need net";
network clients who access some network resource, and network servers
who provide them.
-## Network clients
+### Network clients
Network clients typically want the WAN interface to be up. That may
tempt you to depend on the WAN interface; but first, you should ask
@@ -329,7 +331,7 @@ logged. The signature update service will not crash, and—perhaps more
importantly—you don't want it to terminate if the administrator turns
off the WAN interface for a second.
-## Network servers
+### Network servers
Network servers are generally easier to handle than their client
counterparts. Most server daemons listen on `0.0.0.0` (all addresses)
@@ -350,7 +352,7 @@ If your daemon can optionally be configured to listen on a particular
interface, then please see the "Depending on a particular interface"
section.
-## Depending on a particular interface
+### Depending on a particular interface
If you need to depend on one particular interface, usually it's not
easy to determine programmatically what that interface is. For
@@ -371,8 +373,8 @@ like the following in the service configuration file,
```sh
# Specify the network service that corresponds to the "bind" setting
# in your configuration file. For example, if you bind to 127.0.0.1,
-# this should be set to "net.lo" which provides the loopback interface.
-rc_need="net.lo"
+# this should be set to "loopback" which provides the loopback interface.
+rc_need="loopback"
```
This is a sensible default for daemons that are happy with `0.0.0.0`,
next reply other threads:[~2018-01-09 1:50 UTC|newest]
Thread overview: 150+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 21:34 William Hubbs [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-11-02 23:24 [gentoo-commits] proj/openrc:master commit in: / William Hubbs
2018-10-23 22:14 William Hubbs
2018-10-23 22:00 William Hubbs
2018-10-23 22:00 William Hubbs
2018-10-22 23:09 William Hubbs
2018-06-28 18:33 William Hubbs
2018-06-28 18:03 William Hubbs
2018-06-17 17:46 William Hubbs
2018-06-15 23:07 William Hubbs
2018-06-15 18:01 William Hubbs
2018-06-05 22:38 William Hubbs
2018-06-05 22:38 William Hubbs
2018-06-05 21:28 William Hubbs
2018-05-31 21:54 William Hubbs
2018-03-12 2:43 William Hubbs
2018-02-28 22:32 William Hubbs
2018-01-24 23:44 William Hubbs
2018-01-11 16:59 William Hubbs
2018-01-10 19:29 William Hubbs
2018-01-08 20:07 William Hubbs
2017-12-07 18:53 William Hubbs
2017-10-25 20:10 William Hubbs
2017-10-24 15:43 William Hubbs
2017-10-13 21:11 William Hubbs
2017-10-13 16:38 William Hubbs
2017-10-12 23:55 William Hubbs
2017-10-02 21:59 William Hubbs
2017-10-02 16:22 William Hubbs
2017-09-16 18:27 William Hubbs
2017-09-16 18:27 William Hubbs
2017-09-15 20:32 William Hubbs
2017-09-14 15:57 William Hubbs
2017-09-07 17:25 William Hubbs
2017-09-06 22:33 William Hubbs
2017-08-24 16:45 William Hubbs
2017-08-16 17:16 William Hubbs
2017-07-24 22:29 William Hubbs
2017-07-13 22:51 William Hubbs
2017-07-13 22:51 William Hubbs
2017-07-11 20:13 William Hubbs
2017-07-11 19:57 William Hubbs
2017-06-12 15:41 William Hubbs
2017-06-07 17:15 William Hubbs
2017-05-16 0:00 William Hubbs
2017-05-12 3:01 William Hubbs
2017-04-19 22:38 William Hubbs
2017-04-17 17:49 William Hubbs
2017-03-31 15:37 William Hubbs
2017-03-15 22:31 William Hubbs
2017-03-12 18:56 William Hubbs
2017-03-10 19:33 William Hubbs
2017-01-26 23:07 William Hubbs
2016-12-21 17:51 William Hubbs
2016-12-20 18:34 William Hubbs
2016-09-28 0:40 William Hubbs
2016-09-27 17:26 William Hubbs
2016-09-09 0:28 William Hubbs
2016-08-30 14:16 William Hubbs
2016-08-30 14:16 William Hubbs
2016-08-25 22:35 William Hubbs
2016-07-25 18:54 William Hubbs
2016-06-10 21:12 William Hubbs
2016-05-24 19:10 William Hubbs
2016-05-24 18:14 William Hubbs
2016-05-24 18:05 William Hubbs
2016-05-19 18:37 William Hubbs
2016-02-09 21:42 William Hubbs
2016-01-19 22:33 William Hubbs
2016-01-14 17:37 William Hubbs
2016-01-13 17:04 William Hubbs
2015-12-11 22:49 William Hubbs
2015-12-09 23:58 William Hubbs
2015-12-08 19:12 William Hubbs
2015-12-08 19:12 William Hubbs
2015-12-06 0:14 William Hubbs
2015-12-04 19:52 William Hubbs
2015-10-08 21:15 William Hubbs
2015-10-08 18:34 William Hubbs
2015-07-10 18:26 William Hubbs
2015-06-19 14:56 William Hubbs
2015-05-29 6:11 Mike Frysinger
2015-05-13 21:07 William Hubbs
2015-05-11 23:46 William Hubbs
2015-05-02 0:03 William Hubbs
2015-05-01 21:19 William Hubbs
2015-04-26 15:31 William Hubbs
2015-04-25 23:36 William Hubbs
2015-04-25 1:01 William Hubbs
2015-04-25 0:41 William Hubbs
2015-04-22 22:43 William Hubbs
2015-04-22 22:14 William Hubbs
2015-04-22 22:05 William Hubbs
2015-04-22 21:17 William Hubbs
2015-04-22 20:55 William Hubbs
2015-04-22 20:40 William Hubbs
2015-04-22 20:09 William Hubbs
2015-04-22 20:09 William Hubbs
2015-01-23 18:57 William Hubbs
2014-10-20 20:59 William Hubbs
2014-10-20 20:59 William Hubbs
2014-08-22 19:10 William Hubbs
2014-08-17 5:14 ` William Hubbs
2014-08-17 21:07 William Hubbs
2014-08-22 19:10 ` William Hubbs
2014-08-16 22:18 William Hubbs
2014-08-22 19:10 ` William Hubbs
2014-08-11 18:18 William Hubbs
2014-08-22 19:10 ` William Hubbs
2014-07-10 14:05 William Hubbs
2014-07-01 12:33 William Hubbs
2014-06-24 1:54 William Hubbs
2014-04-10 0:58 William Hubbs
2014-01-23 18:04 William Hubbs
2013-08-24 23:00 William Hubbs
2013-08-14 6:08 William Hubbs
2013-08-14 5:17 William Hubbs
2013-07-16 18:56 William Hubbs
2013-07-16 18:56 William Hubbs
2013-06-24 21:31 Robin H. Johnson
2013-05-07 22:08 William Hubbs
2013-05-07 19:40 William Hubbs
2012-11-02 21:41 William Hubbs
2012-10-18 15:14 William Hubbs
2012-09-23 16:12 William Hubbs
2012-07-09 2:05 William Hubbs
2012-05-22 15:14 William Hubbs
2012-03-02 19:55 Robin H. Johnson
2012-02-12 19:38 Christian Ruppert
2012-01-25 19:04 Robin H. Johnson
2012-01-14 20:11 William Hubbs
2012-01-07 0:02 William Hubbs
2011-12-09 23:49 William Hubbs
2011-11-25 21:40 William Hubbs
2011-11-23 14:38 William Hubbs
2011-10-16 15:36 Christian Ruppert
2011-09-08 20:13 William Hubbs
2011-09-08 18:31 William Hubbs
2011-09-02 20:26 William Hubbs
2011-09-01 22:21 William Hubbs
2011-09-01 15:35 William Hubbs
2011-07-13 22:54 William Hubbs
2011-06-24 17:47 William Hubbs
2011-06-20 2:39 William Hubbs
2011-05-16 22:05 Mike Frysinger
2011-04-19 17:19 Robin H. Johnson
2011-04-16 1:02 William Hubbs
2011-04-12 13:49 William Hubbs
2011-03-22 5:49 William Hubbs
2011-02-22 2:59 Robin H. Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1515447183.92cfa0e543d380ab290d06e98e2fef1b283349fe.williamh@OpenRC \
--to=williamh@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox