service/doc/service.1.scd

127 lines
3.7 KiB
Plaintext
Raw Normal View History

2019-11-12 20:03:45 +01:00
service(1)
# NAME
service - system services control and querying interface
# SYNOPSIS
*service* add <service> [options]
*service* start <service>
*service* stop <service>
*service* status [-v] [service [service [...]]
*service* reload <service>
*service* del <service>
*service* show <service>
# DESCRIPTION
2019-11-13 00:40:13 +01:00
*service* is a tool that starts, stops, lists, queries, creates or removes system services.
*service* abstracts their configuration and handles their dependencies to one another.
2019-11-12 20:03:45 +01:00
Some general concepts about WeirdOS services management and boot procedure can be found in *service*(7).
# USAGE
## Identifying Services
service show <id>
service status [-v|--verbose] [id [id [...]]]
Service ids are the name of a service, that may be prefixed by the name of their environment and a slash ('/').
*service show* shows all of a services relationship to other services as well as its full configuration as handled by `service`.
*service status* shows the status of one or multiple services, including whether they are currently running or not.
If no parameter is provided to the `status` command, it will show the status of all services.
If the `--verbose` flag is provided, informations about what tokens a service produces or consumes, as well as the ports it reserves, will be displayed as well.
## Starting Services
service start <id>
2019-11-16 18:04:23 +01:00
When *service* starts services, it also starts their dependencies.
2019-11-12 20:03:45 +01:00
If a service is depended on by a non-runnable service, the non-runnable services will have their configuration and deployable files generated once its last dependency is started.
An example for this is a static website that depends on a web server: if the web server is started, the static websites files and possible configuration will be generated or installed where they will be served.
2019-11-16 18:04:23 +01:00
To force a service the use of a particular provider, the syntax token_id=service_id can be used.
If providers are guessed, those from the same environment as the service to be created are used first, if any.
Services from the *root* environment are tried next.
To force *not* using a token, the token_id=none syntax can be used.
The type=service_type syntax can be used to specify what kind of service is to be created if its name does not match a known service definition.
The domain=example.tld syntax can be used to specify domain names when creating services that require one.
2019-11-12 20:03:45 +01:00
## Stopping Services
service stop <id>
## Adding Services
service add <id> [options]
2019-11-13 00:40:13 +01:00
The *service add* command can be used to create a service.
2019-11-12 20:03:45 +01:00
Only services that have been “added” to the list of known services can be started.
It takes as first parameter the *id* of the service to create.
The service type defaults to the name of the service to be created.
## Removing Services
service del <id> [options]
2019-11-13 00:40:13 +01:00
The *service del* command removes a service from the system.
2019-11-12 20:03:45 +01:00
Be careful, as this command also removes its configuration and data.
*service del* will not let you remove services that are being depended on unless you provide a `--force` flag.
*service del* will stop services before removing them.
# EXAMPLES
## Starting a Service
2019-11-16 18:04:23 +01:00
service start gitea
2019-11-12 20:03:45 +01:00
## Registering a Single Service
service add postgresql
service start postgresql
## Registering Multiple Services with Dependencies
service add nginx
service add postgresql
service add gitea http=nginx postgresql=postgresql domain=gitea.test
In this example, the dependencies of the “gitea” service could have been guessed automatically.
2019-11-16 18:04:23 +01:00
The following example does the exact same thing but lets *service* guess dependencies.
2019-11-12 20:03:45 +01:00
service add nginx
service add postgresql
service add gitea domain=gitea.test
# SEE ALSO
2019-11-16 18:04:23 +01:00
*service*(7)
2019-11-12 20:03:45 +01:00
# AUTHORS
Luka Vandervelden <lukc@upyum.com>