.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "CDIST-TYPE__SYSTEMD_SERVICE" "7" "Sep 26, 2023" "7.0.0" "cdist" .SH NAME .sp cdist\-type__systemd_service \- Controls a systemd service state .SH DESCRIPTION .sp 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. .sp The activation or deactivation is out of scope. Look for the \fBcdist\-type__systemd_util\fP(7) type instead. .SH REQUIRED PARAMETERS .sp None. .SH OPTIONAL PARAMETERS .INDENT 0.0 .TP .B name String which will used as name instead of the object id. .TP .B state The state which the service should be in: .INDENT 7.0 .TP .B running Service should run (default) .TP .B stopped Service should be stopped .UNINDENT .TP .B action Executes an action on on the service. It will only execute it if the service keeps the state \fBrunning\fP\&. There are following actions, where: .INDENT 7.0 .TP .B reload Reloads the service .TP .B restart Restarts the service .UNINDENT .UNINDENT .SH BOOLEAN PARAMETERS .INDENT 0.0 .TP .B if\-required Only execute the action if at minimum one required type outputs a message to \fB$__messages_out\fP\&. Through this, the action should only executed if a dependency did something. The action will not executed if no dependencies given. .UNINDENT .SH MESSAGES .INDENT 0.0 .TP .B start Started the service .TP .B stop Stopped the service .TP .B restart Restarted the service .TP .B reload Reloaded the service .UNINDENT .SH ABORTS .sp Aborts in following cases: .sp systemd or the service does not exist .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .EX # service must run __systemd_service nginx # service must stopped __systemd_service sshd \e \-\-state stopped # restart the service __systemd_service apache2 \e \-\-action restart # makes sure the service exist with an alternative name __systemd_service foo \e \-\-name sshd # reload the service for a modified configuration file # only reloads the service if the file really changed require=\(dq__file/etc/foo.conf\(dq __systemd_service foo \e \-\-action reload \-\-if\-required .EE .UNINDENT .UNINDENT .SH AUTHORS .sp Matthias Stecher .SH COPYRIGHT .sp 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. .SH COPYRIGHT ungleich GmbH 2021 .\" Generated by docutils manpage writer. .