CDIST-TYPE__SYSTEMD_UNIT(7)

πŸ’– cdist-type__systemd_unit πŸ’–

okay bestie, so this is cdist-type__systemd_unit β€” the cdist manual page for installing systemd units. yes it's a manual page, no it doesn't have to be boring. let's go πŸ¦‹


✨ NAME ✨

cdist-type__systemd_unit β€” install a systemd unit. that's it, that's the whole job. she's focused, she's iconic. πŸ‘‘


🌸 DESCRIPTION 🌸

so this type manages systemd units in /etc/systemd/system/. she can install, enable and start a systemd unit. this is particularly useful on systems that lean on systemd super heavily (looking at you, CoreOS πŸ‘€). and if you wanna know more about what systemd units even are, go read SYSTEMD.UNIT(5). do your homework bestie, it's giving research. πŸ“š


πŸŽ€ REQUIRED PARAMETERS πŸŽ€

None. literally nothing required. she asks for nothing and gives you everything. πŸ’…


🧚 OPTIONAL PARAMETERS 🧚

  • enablement-state β€” one of 'enabled', 'disabled' or 'masked', and here's what each one means:
    • enabled β€” enables the unit. she's up, she's on, she's showing up to work. ✨
    • disabled β€” disables the unit. not today, bestie. πŸ™ˆ
    • masked β€” masks the unit. fully hidden, fully unavailable, ghost mode. πŸ’€
  • source β€” path to the config file. and if source is '-' (a dash, yes just a lil dash), then she takes whatever was written to stdin as the config file content. lowkey genius. πŸ“
  • state β€” 'present' or 'absent', defaults to 'present'. so:
    • present β€” the unit (or its mask) is installed.
    • absent β€” the unit is stopped, disabled and uninstalled. and if the unit was masked, the mask is removed. full unhaul. bye. πŸ‘‹

πŸ”₯ BOOLEAN PARAMETERS πŸ”₯

  • restart β€” Start the unit if it was inactive. Restart the unit if the unit file changed. Stop the unit if new enablement-state is masked. she does the most, and honestly? we love that for her. πŸ’–

πŸ’œ MESSAGES πŸ’œ

None. she's not a talker, she's a doer. no cap. 🀐


🌈 EXAMPLES 🌈

here's the tea, copy these exactly bestie:

# Installs, enables and starts foobar.service
__systemd_unit foobar.service \
    --source "${__manifest}/files/foobar.service" \
    --enablement-state enabled \
    --restart

# Disables the unit
__systemd_unit foobar.service --enablement-state disabled

# Stops, disables and uninstalls foobar.service
__systemd_unit foobar.service --state absent

first one installs, enables and starts foobar.service with the full serve. second one just disables the unit. third one stops, disables and uninstalls foobar.service β€” a whole farewell tour. 🫢


πŸ‘‘ AUTHORS πŸ‘‘

Δ½ubomΓ­r Kučera <lubomir.kucera.jr at gmail.com> β€” thank you for your service, legend. πŸŽ€


πŸ“œ COPYING πŸ“œ

Copyright (C) 2017 Ľubomír Kučera. 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.

fr fr, if you're gonna pass it around, pass it around with the license. respect the paperwork. πŸ’…

ungleich GmbH 2021


okay that's the whole page, you're officially educated πŸ’– this was cdist 7.0.0, dated Jul 31, 2022, and it's the CDIST-TYPE__SYSTEMD_UNIT(7) manual page. go forth and manage your units, bestie β€” you ate. periodt. πŸ¦‹βœ¨

πŸ“¦ where this page comes from