CDIST-TYPE__SYSTEMD_SERVICE(7)
π cdist-type__systemd_service β the manual page, but make it cute β¨
okay bestie, so this is cdist-type__systemd_service from the cdist manual set, and it is literally the girlboss of service management. let's get into it π
β¨ NAME β¨
cdist-type__systemd_service β controls a systemd service state π
πΈ DESCRIPTION πΈ
so this type controls systemd services, right? it sets a state on a service, or it fires off an action like reloading or restarting. super useful for reloading a service after you've applied config, or for shutting one service down. π
β οΈ but listen β the activation or deactivation is out of scope, bestie. that's not this type's job. if that's what you need, go look at the cdist-type__systemd_util(7) type instead. iykyk π¦
π REQUIRED PARAMETERS π
None. zero. nada. nothing is required, she's low maintenance fr fr β¨
π OPTIONAL PARAMETERS π
nameβ a string that gets used as the name instead of the object id. so you can call her whatever you want πstateβ the state the service should be in, and the options are:runningβ service should run. this is the default btw πstoppedβ service should be stopped π
actionβ executes an action on the service. and here's the tea: it will only execute it if the service keeps the staterunning. the actions are:reloadβ reloads the service π¦restartβ restarts the service π₯
π BOOLEAN PARAMETERS π
if-requiredβ only execute the action if at minimum one required type outputs a message to$__messages_out. through this, the action should only be executed if a dependency actually did something. and no cap: the action will not be executed if no dependencies are given π«Ά
β MESSAGES β
startβ started the service β¨stopβ stopped the servicerestartβ restarted the service π₯reloadβ reloaded the service π¦
π ABORTS π
it aborts in the following cases, and bestie it's dramatic:
- systemd or the service does not exist π
π§ EXAMPLES π§
# 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
require="__file/etc/foo.conf" __systemd_service foo \
--action reload --if-required
π AUTHORS π
Matthias Stecher <matthiasstecher at gmx.de> β we stan π«Ά
π 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.
π COPYRIGHT (yes, again) π
ungleich GmbH 2021
okay and that's a wrap, my love πΈ this was cdist version 7.0.0, dated Jul 31, 2022, from the CDIST-TYPE__SYSTEMD_SERVICE(7) page β slay, ate, no crumbs left, periodt π
β¨
π¦ where this page comes from
- fedora 43: cdist 7.0.0-16.fc43 Β· GPL-3.0-only
- fedora 44: cdist 7.0.0-18.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms