CDIST-TYPE__PROCESS(7)
π cdist-type__process(7) π
okay bestie so this is a page from cdist β the manual name is cdist-type__process, and it's about a type that literally just starts and stops processes for you. no cap. π«Ά
β¨ NAME β¨
cdist-type__process β Start or stop process
πΈ DESCRIPTION πΈ
This cdist type lets you declare the state of a process. That's it. That's the vibe. You say "hey this should be running" or "hey this should NOT be running" and the type goes and makes it so. π
π OPTIONAL PARAMETERS π
stateβ Either"present"or"absent", and if you don't say anything it defaults to"present". (so by default it's out here trying to keep stuff alive, main character energy fr fr)nameβ the process name you wanna match on when it runspgrep -f -x. π
This one is lowkey important when your name starts with a "/", because cdist strips that leading slash away from the object id. so like, without this, your slash just... vanishes. gone. not me being dramatic, it's literally what happens. π
stopβ the executable it should use to stop the process.startβ the executable it should use to start the process.
π¦ MESSAGES π¦
startedβ The process was started. β¨ (it's giving successful launch)stoppedβ The process was stopped. π (in the good way, the intentional way)
π EXAMPLES π
these are the real ones, copied exactly, don't come for me π
# Start if not running
__process /usr/sbin/syslog-ng --state present
# Start if not running with a different binary
__process /usr/sbin/nginx --state present --start "/etc/rc.d/nginx start"
# Stop the process using kill (the type default) - DO NOT USE THIS
__process /usr/sbin/sshd --state absent
# Stop the process using /etc/rc.d/sshd stop - THIS ONE NOT AS WELL
__process /usr/sbin/sshd --state absent --stop "/etc/rc.d/sshd stop"
# Ensure cups is running, which runs with -C ...:
__process cups --start "/etc/rc.d/cups start" --state present \
--name "/usr/sbin/cupsd -C /etc/cups/cupsd.conf"
# Ensure rpc.statd is running (which usually runs with -L) using a regexp
__process rpcstatd --state present --start "/etc/init.d/statd start" \
--name "rpc.statd.*"
bestie PLEASE read those comments. two of those examples are literally labeled DO NOT USE THIS and THIS ONE NOT AS WELL. the defaultkillstop is a no-no, and the/etc/rc.d/sshd stopversion is also a no-no. don't do it. i'm not explaining why beyond what the page says, i'm just telling you it's marked as a bad idea. periodt. π
also the --name examples are iconic: cups needs the full "/usr/sbin/cupsd -C /etc/cups/cupsd.conf" string because of that -C, and rpcstatd uses a regexp "rpc.statd.*" because of its -L. iykyk. π₯
β SEE ALSO β
cdist-type__start_on_boot(7)β go read this one too, bestie π§
π AUTHORS π
- Nico Schottelius
<nico-cdist--@--schottelius.org> - Thomas Eckert
<tom--@--it-eckert.de>
π COPYING π
Copyright (C) 2011-2012 Nico Schottelius. 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 π
ungleich GmbH 2021
and that's the whole page, bestie π this was version 7.0.0, dated Jul 31, 2022 β shoutout to the cdist crew for keeping our processes in check. slay, stay hydrated, and don't use that default kill stop. mwah πβ¨
π¦ 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