66

Software

obarun.org

Identifier interpretation

The following table provides a comprehensive understanding of various identifiers used in the system. If an identifier is invalid, it will remain unchanged. In this context, the term user refers to the owner of the process.

Identifiers are replaced at two distinct moments:

Identifier Meaning Replaced by
@I Instance name For instantiated services, this is the string between the first @ character and the rest of the instantiated service name. For non-instantiated services, it is the service name. Parse time only (see below).
@U User name The user name. If the user is 0, it is replaced by root.
@u User UID The numeric user ID (UID).
@G User group The user group name.
@g User GID The numeric group ID (GID).
@H User home directory The user’s home directory. For user 0, it is /root.
@S User shell The user’s shell.
@R User runtime directory The user’s runtime directory. For user 0, it is /run; for other users, it corresponds to $XDG_RUNTIME_DIR.

By understanding these identifiers and their replacements, you can effectively create and manage service files and scandir environment files, ensuring that owner-specific details are correctly populated.

@I is parse time only

@I resolves an instance name, which only exists while parsing an instantiated frontend such as tty@tty1. There is no instance context at runtime, so @I is never expanded at runtime: it is left untouched in scandir environment files and in service environment files loaded by execl-envfile. Every other identifier is expanded in every context and resolves against the process owner.

Examples of identifiers usage