Files
systemd/units/systemd-machine-tag@.service
Lennart Poettering 432f54118d units: add systemd-machine-tag@.service template
Add a service template that adds the machine tag given as its instance
name to the host's machine tags. Whenever an instance is pulled in, the
tag is added; the operation is idempotent.

It talks to hostnamed over Varlink (which is socket-activated), so it
works very early at boot, before the system bus is up. It is ordered
after local-fs.target so that /etc/machine-info can be written, requires
hostnamed's socket and the local filesystems to be available, and does
not run in the initrd.
2026-06-01 10:56:16 +02:00

24 lines
787 B
Desktop File

# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Add Machine Tag %i
Documentation=man:systemd-machine-tag@.service(8)
DefaultDependencies=no
ConditionPathExists=!/etc/initrd-release
After=local-fs.target systemd-hostnamed.socket
Requisite=local-fs.target systemd-hostnamed.socket
Before=shutdown.target
Conflicts=shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=varlinkctl call /run/systemd/io.systemd.Hostname io.systemd.Hostname.SetTags '{"add":["%i"]}'