Skip to content
Snippets Groups Projects
Commit b267358b authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

typo fix

parent ba82ead5
No related branches found
No related tags found
No related merge requests found
Pipeline #13769 passed
......@@ -11,13 +11,13 @@ author: Eric Vidal <eric@obarun.org>
The [s6](https://skarnet.org/software/s6) programs use different files. It is quite complex to understand and manage the relationship between all those files. If you're interested in the details you should read [the documentation for the s6 servicedir](https://skarnet.org/software/s6/servicedir.html) and also about [classic](https://skarnet.org/software/s6/servicedir.html) and [module](frontend.html#Module service creation) services. The frontend service file of `66` program allows you to deal with all these different services in a centralized manner and in one single location.
By default `66` program expects to find service files in `%%service_system%%` and `%%service_adm%%` for root user. For regular users, `$HOME/%%service_user%%` will take priority over the previous ones. Although this can be changed at compile time by passing the `--with-system-service=DIR`, `--with-sysadmin-service=DIR` and `--with-user-service=DIRoption` to `./configure`.
By default `66` program expects to find service files in `%%service_system%%` and `%%service_adm%%` for root user, `%%service_system%%/user` and `%%service_adm/user%%` for regular accounts. For regular accounts, `$HOME/%%service_user%%` will take priority over the previous ones. Although this can be changed at compile time by passing the `--with-system-service=DIR`, `--with-sysadmin-service=DIR` and `--with-user-service=DIRoption` to `./configure`.
The frontend service file has a format of `INI` with a specific syntax on the key field. The name of the file usually corresponds to the name of the daemon and does not have any extension or prefix.
The file is made of *sections* which can contain one or more `key value` pairs where the *key* name can contain special characters like `-` (hyphen) or `_` (low line) except the character `@` (commercial at) which is reserved.
You can find a prototype with all valid section and all valid `key=value` pair at the end of this [document](frontend.html#Prototype of a frontend file).
You can find a prototype with all valid section and all valid `key=value` pair at the end of this [document](frontend.html#prototype-of-a-frontend-file).
### File names examples
......@@ -58,12 +58,12 @@ All sections need to be declared with the name written between square brackets `
The frontend service file allows the following section names:
- [[main]](frontend.html#Section: [main])
- [[start]](frontend.html#Section: [start])
- [[stop]](frontend.html#Section: [stop])
- [[logger]](frontend.html#Section: [logger])
- [[environment]](frontend.html#Section: [environment])
- [[regex]](frontend.html#Section: [regex])
- [[main]](frontend.html#section-main)
- [[start]](frontend.html#section-start)
- [[stop]](frontend.html#section-stop)
- [[logger]](frontend.html#section-logger)
- [[environment]](frontend.html#section-environment)
- [[regex]](frontend.html#section-regex)
Although a section can be mandatory not all of its key fields must be necessarily so.
......@@ -242,7 +242,7 @@ The *value* of a *key* is parsed in a specific format depending on the key. The
----
## Section: [main]
## Section [main]
This section is *mandatory*. (!)
......@@ -420,7 +420,7 @@ This section is *mandatory*. (!)
@options = ( !log )
````
The behavior of the logger can be configured in the corresponding section—see [[logger]](frontend.html#Section: [logger]).
The behavior of the logger can be configured in the corresponding section—see [[logger]](frontend.html#section-logger).
---
......@@ -578,11 +578,9 @@ This section is *mandatory*. (!)
**Note**: If a corresponding [seed](tree.html#seed-files) file exist on your system, its will be used to create and configure the tree.
---
---
## Section: [start]
## Section [start]
This section is *mandatory*. (!)
......@@ -600,7 +598,7 @@ This section is *mandatory*. (!)
The corresponding file to start the service will automatically be written in [execline](https://skarnet.org/software/execline) format with the `@execute` key value.
* custom : creates the service script file making a verbatim copy of the `@execute` field of the section. Do not forget to set the shebang of the script at `@execute` key.
* custom : creates the service script file making a verbatim copy of the `@execute` field of the section. **Do not forget** to set the shebang of the script at `@execute` key.
---
......@@ -647,28 +645,28 @@ This section is *mandatory*. (!)
---
## Section: [stop]
## Section [stop]
This section is *optional*.
This section is exactly the same as [[start]](frontend.html#Section: [start]) and shares the same keys. With the exception that it will handle the stop process of the service.
This section is exactly the same as [[start]](frontend.html#section-start) and shares the same keys. With the exception that it will handle the stop process of the service.
---
## Section: [logger]
## Section [logger]
This section is *optional*.
It will only have effects if value *log* was **not** prefixed by an exclamation mark to the `@options` key in the [[main]](frontend.html#Section: [main]) section.
It will only have effects if value *log* was **not** prefixed by an exclamation mark to the `@options` key in the [[main]](frontend.html#section-main) section.
This section extends the `@build`, `@runas`, and `@execute` key fields from [[start]](frontend.html#Section: [start]) and the `@timeout-finish` and `@timeout-kill` key fields from [[main]](frontend.html#Section: [main]) . These are also valid keys for [[logger]](frontend.html#Section: [logger]) and behave the same way they do in the other sections but they can not be specified except for the mandatory key `@build`—see example below. In such case the default behaviour for those key are apply.
This section extends the `@build`, `@runas`, and `@execute` key fields from [[start]](frontend.html#section-start) and the `@timeout-finish` and `@timeout-kill` key fields from [[main]](frontend.html#section-main) . These are also valid keys for [[logger]](frontend.html#section-logger) and behave the same way they do in the other sections but they can not be specified except for the mandatory key `@build`—see example below. In such case the default behaviour for those key are apply.
Furthermore there are some keys specific to the log.
### Valid *key* names:
- `@build`, `@runas`, and `@execute` — See [[start]](frontend.html#Section: [start])
- `@timeout-finish`, `@timeout-kill` — See [[main]](frontend.html#Section: [main])
- `@build`, `@runas`, and `@execute` — See [[start]](frontend.html#section-start)
- `@timeout-finish`, `@timeout-kill` — See [[main]](frontend.html#section-main)
---
......@@ -734,7 +732,7 @@ Furthermore there are some keys specific to the log.
The logged line will not be preceded by any timestamp.
The following are two possible examples for the [[logger]](frontend.html#Section: [logger]) section definition.
The following are two possible examples for the [[logger]](frontend.html#section-logger) section definition.
````
[logger]
......@@ -754,7 +752,7 @@ Furthermore there are some keys specific to the log.
---
## Section: [environment]
## Section [environment]
This section is *optional*.
......@@ -801,7 +799,7 @@ A file containing the `key=value` pair(s) will be created by default at `%%servi
---
## Section: [regex]
## Section [regex]
This section is *optional*.
......@@ -873,8 +871,6 @@ You can use the `@I` string as key field. It will be replaced by the `module` na
* It opens the file named mount-tmp, search for the args regex and replaces it by the value of the regex.
* It opens all files found on the module directory and replaces all regex 'user' found by the name of the module in each file.
---
---
## A word about the @execute key
......@@ -914,39 +910,39 @@ Furthermore when you set `@build` to auto the parser will take care about the re
echo "the error of the daemon written into the appropriate file"
```
Finally you need to take care about how you define your environment variable in the section [[environment]](frontend.html#Section: [environment]). When setting `@build` to auto the parser will also take care about the `!` character if you use it. This character will have no **effect** in the case of custom.
Finally you need to take care about how you define your environment variable in the section [[environment]](frontend.html#section-environment). When setting `@build` to auto the parser will also take care about the `!` character if you use it. This character will have no **effect** in the case of custom.
This same behavior applies to the [[logger]](frontend.html#Section: [logger]) section. The fields `@destination`, `@backup`, `@maxsize` and `@timestamp` will have **no effect** in a custom case. You need to explicitly define the program to use the logger and the options for it in your `@execute` field.
This same behavior applies to the [[logger]](frontend.html#section-logger) section. The fields `@destination`, `@backup`, `@maxsize` and `@timestamp` will have **no effect** in a custom case. You need to explicitly define the program to use the logger and the options for it in your `@execute` field.
---
## Prototype of a frontend file
The minimal template is:
The minimal template is e.g.:
```
[main]
@type = classic,bundle,longrun,oneshot,module
@version = 0.0.0
@description = ""
@user = ()
@type = classic
@version = 0.0.1
@description = "Template example"
@user = ( root )
[start]
@execute = ()
@execute = ( /usr/bin/true )
```
This prototype contain all valid section with all valid `key=value` pair.
```
[main]
@type = classic,longrun,bundle,module
@type =
@description = ""
@version = 0.0.0
@version =
@depends = ()
@requiredby = ()
@optsdepends = ()
@options = ( log )
@flags = ( down earlier )
@options = ()
@flags = ()
@notify =
@user = ()
@timeout-finish =
......@@ -959,19 +955,19 @@ This prototype contain all valid section with all valid `key=value` pair.
@intree =
[start]
@build = auto,custom
@build =
@runas =
@execute = ()
[stop]
@build = auto,custom
@build =
@runas =
@execute = ()
[logger]
@build = auto,custom
@build =
@runas =
@destination = /path
@destination =
@backup =
@maxsize =
@timestamp =
......@@ -984,8 +980,8 @@ This prototype contain all valid section with all valid `key=value` pair.
ANOTHERKEY=!antohervalue
[regex]
@configure = "arguments to pass to the configure script"
@directories = ( key=value key=value )
@files = ( key=value key=value )
@infiles = ( :filename:key=value ::key=value )
@configure = ""
@directories = ()
@files = ()
@infiles = ()
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment