Refactor, simplify text and rename section

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2018-01-16 16:02:06 +01:00
1 parent 30c593f64e
commit d72eb45d6e
1 file changed
+17 -13
+17 -13
View File
@@ -2,6 +2,7 @@ Configuration
============= =============
* [Introduction](#introduction) * [Introduction](#introduction)
* [Service Wrapper Scripts](#service-wrapper-scripts)
* [Syntax](#syntax) * [Syntax](#syntax)
* [Limitations](#limitations) * [Limitations](#limitations)
* [/etc/finit.conf](#etcfinitconf) * [/etc/finit.conf](#etcfinitconf)
@@ -48,24 +49,26 @@ On `initctl reload` the following is checked for all services:
For more info on the different states of a service, see the separate For more info on the different states of a service, see the separate
document [Finit Services](service.md). document [Finit Services](service.md).
### Execute pre commands for a service
If your service requires to run additional commands that are executed before Service Wrapper Scripts
the service is actually started (something like systemds `ExecStartPre`) you -----------------------
can use a wrapper shell script which runs the additional commands before
executing the service.
The Finit service .conf file can be put into `/etc/finit.d/available` so you If your service requires to run additional commands, executed before the
can control the service using `initctl`. Just place in the service .conf file service is actually started, like the systemd `ExecStartPre`, you can
the path to the wrapper shell script, e.g. if the wrapper is located in use a wrapper shell script to start your service.
`/etc/start.d`:
The Finit service `.conf` file can be put into `/etc/finit.d/available`,
so you can control the service using `initctl`. Then use the path to
the wrapper script in the Finit `.conf` service stanza. The following
example employs a wrapper script in `/etc/start.d`.
**Example:** **Example:**
`/etc/finit.d/available/program.conf`: `/etc/finit.d/available/program.conf`:
```conf ```conf
service [235] <!> /etc/start.d/program -- Example Program service [235] <!> /etc/start.d/program -- Example Program
``` ```
**Example:**
`/etc/start.d/program:` `/etc/start.d/program:`
```shell ```shell
#!/bin/sh #!/bin/sh
@@ -77,9 +80,10 @@ OPTIONS="-u $(cat /etc/username)"
exec /usr/bin/program $OPTIONS exec /usr/bin/program $OPTIONS
``` ```
*Note, that the example sets `<!>` to denote that it doesn't support SIGHUP. That **Note:**, that the example sets `<!>` to denote that it doesn't support
way Finit will stop/start such the service instead of sending SIGHUP at `SIGHUP`. That way Finit will stop/start such the service instead of
restart/reload.* sending SIGHUP at restart/reload.
Syntax Syntax
------ ------