cdist-web/src/extra/manual/beta/_sources/man7/cdist-type__systemd_service...

118 lines
2.4 KiB
Plaintext
Raw Normal View History

2020-09-11 12:35:41 +00:00
cdist-type__systemd_service(7)
2020-02-15 13:54:41 +00:00
==============================
NAME
----
2020-09-11 12:35:41 +00:00
cdist-type__systemd_service - Controls a systemd service state
2020-02-15 13:54:41 +00:00
DESCRIPTION
-----------
This type controls systemd services to define a state of the service,
or an action like reloading or restarting. It is useful to reload a
service after configuration applied or shutdown one service.
The activation or deactivation is out of scope. Look for the
:strong:`cdist-type__systemd_util`\ (7) type instead.
2020-09-11 12:35:41 +00:00
2020-02-15 13:54:41 +00:00
REQUIRED PARAMETERS
-------------------
None.
2020-09-11 12:35:41 +00:00
2020-02-15 13:54:41 +00:00
OPTIONAL PARAMETERS
-------------------
name
String which will used as name instead of the object id.
state
The state which the service should be in:
running
Service should run (default)
2020-09-11 12:35:41 +00:00
stopped
Service should be stopped
2020-02-15 13:54:41 +00:00
action
Executes an action on on the service. It will only execute it if the
2020-09-11 12:35:41 +00:00
service keeps the state ``running``. There are following actions, where:
2020-02-15 13:54:41 +00:00
reload
Reloads the service
restart
Restarts the service
BOOLEAN PARAMETERS
2020-02-27 19:39:21 +00:00
------------------
2020-02-15 13:54:41 +00:00
if-required
2020-09-11 12:35:41 +00:00
Only execute the action if at minimum one required type outputs a message
to ``$__messages_out``. Through this, the action should only executed if a
2020-02-15 13:54:41 +00:00
dependency did something. The action will not executed if no dependencies
given.
2020-09-11 12:35:41 +00:00
2020-02-15 13:54:41 +00:00
MESSAGES
--------
start
Started the service
stop
Stopped the service
restart
Restarted the service
reload
Reloaded the service
2020-09-11 12:35:41 +00:00
2020-02-15 13:54:41 +00:00
ABORTS
------
Aborts in following cases:
systemd or the service does not exist
2020-09-11 12:35:41 +00:00
2020-02-15 13:54:41 +00:00
EXAMPLES
--------
.. code-block:: sh
# service must run
__systemd_service nginx
# service must stopped
__systemd_service sshd \
--state stopped
# restart the service
__systemd_service apache2 \
--action restart
# makes sure the service exist with an alternative name
__systemd_service foo \
--name sshd
# reload the service for a modified configuration file
# only reloads the service if the file really changed
2020-09-11 12:35:41 +00:00
require="__file/etc/foo.conf" __systemd_service foo \
2020-02-15 13:54:41 +00:00
--action reload --if-required
2020-09-11 12:35:41 +00:00
2020-02-15 13:54:41 +00:00
AUTHORS
-------
Matthias Stecher <matthiasstecher at gmx.de>
2020-09-11 12:35:41 +00:00
2020-02-15 13:54:41 +00:00
COPYRIGHT
---------
Copyright \(C) 2020 Matthias Stecher. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.