SYSTEMD-M...@.SERVICE(8)
β¨ NAME β¨
systemd-machine-tag@.service β bestie, this one literally just adds a machine tag to the host π
πΈ SYNOPSIS πΈ
systemd-machine-tag@.service
π DESCRIPTION π
okay so picture this: systemd-machine-tag@TAG.service is a service template, right? and what it does is it takes the tag TAG β which it grabs straight out of the instance name β and adds it to the host's list of machine tags. the moment any instance of this template gets pulled in, boom, that tag is added. and here's the slay part: the whole operation is idempotent, so pulling it in over and over again literally does nothing extra. no cap. π
βοΈ
the main character use case here is automatic, hardware-driven tagging: when the SYSTEMD_MACHINE_TAG udev property is set on a device, it causes the matching instance of this template to get pulled in (via SYSTEMD_WANTS=), which means plugging in β or just detecting β a specific device automatically tags the host. it's giving plug-and-play but make it tagging. π₯ if you wanna know how the SYSTEMD_WANTS= mechanism actually works under the hood, go read systemd.device(5).
you can peek at and edit your machine tags with the tags verb of hostnamectl(1) (iykyk), and they live in the TAGS= field of machine-info(5). π
tiny little rules tho, bestie, don't skip them:
- each tag must be 1...255 characters long
- and it can only contain ASCII alphanumeric characters,
-and.
that's it. that's the whole vibe check. β
Added in version 262. π¦
π SEE ALSO π
and that's the page, bestie!! π«Ά this whole thing shipped with systemd 262.1 and it lives in section 8 as SYSTEMD-M...@.SERVICE(8). go tag something iconic ππ
π¦ where this page comes from
- arch rolling: systemd 262.1-1 Β· LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms