Files
webmin/systemd/help/systemd_unitconf.html
Ilia Ross d94000afbd Add Systemd Services and Units module
This PR adds a standalone Systemd Services and Units module for managing systemd units across system and user scopes.

The module keeps systemd-specific behavior separate from the legacy Bootup and Shutdown module and is implemented as standalone `strict`/`warnings` Perl code rather than depending on its existing init helpers. Those helpers intentionally smooth over multiple init systems, while this module keeps systemd-specific file handling, user-manager behavior, ACL checks, and control operations explicit, scoped, and easier to audit.

It includes:

- Tabbed views for services, timers, sockets, paths, targets, storage, resources, devices, and user units
- Guided creation and editing for common unit types, with contextual fields, validation, and help
- User-scoped unit management with linger support and safe handling of home-directory unit files
- Runtime actions for start, stop, restart, enable, disable, status, logs, properties, dependencies, and system-unit mask/unmask
- Drop-in override inventory plus create, edit, and delete flows
- Manual unit-file editing with daemon reload reminders and actions
- Configurable module behavior, visible tabs, display options, and post-create navigation
- Comprehensive ACL controls for system/user scopes, actions, manual edits, drop-ins, linger, reload, backup, and user filters
- Safe Webmin user support through a scoped safe ACL preset
- Virtualmin integration for granting domain owners access to their own systemd user units
- Tests for unit generation, safety checks, ACL behavior, user-unit handling, backup coverage, and Perl::Critic compatibility

A companion Virtualmin PR adds template integration so domain owners can be granted scoped access to their own systemd user units when this module is installed.
2026-06-12 20:55:28 +02:00

32 lines
2.0 KiB
HTML

<header>Type-specific settings</header>
<p>Directives for the selected non-service unit type. Enter directives only,
without the section header; the correct section will be written, such as
<tt>[Timer]</tt>, <tt>[Socket]</tt>, <tt>[Path]</tt>, <tt>[Mount]</tt>,
<tt>[Automount]</tt>, <tt>[Swap]</tt>, or <tt>[Slice]</tt>.</p>
<p>Mount and automount units have dedicated fields for their common settings.
Use this field only for uncommon directives that are not shown elsewhere in
the form.</p>
<p>For a timer, examples include <tt>OnCalendar=daily</tt>,
<tt>Persistent=true</tt>, and <tt>Unit=myjob.service</tt>. If <tt>Unit=</tt>
is omitted, systemd activates the service with the same base name, such as
<tt>myjob.service</tt> for <tt>myjob.timer</tt>.</p>
<p>For a socket, examples include <tt>ListenStream=8080</tt>,
<tt>ListenStream=/run/myapp.sock</tt>, <tt>Accept=false</tt>, and
<tt>Service=myapp.service</tt>. For user units, filesystem socket paths should
be below a location the selected user can write, such as
<tt>/run/user/UID</tt>. If <tt>Service=</tt> is omitted, systemd uses the
service with the same base name.</p>
<p>For a path unit, examples include <tt>PathChanged=/srv/myapp</tt>,
<tt>PathExists=/var/run/myapp.ready</tt>, and <tt>Unit=myjob.service</tt>.
For user units, watched paths should normally be below the selected user's
home directory or runtime directory.</p>
<p>Target units do not need a type-specific settings body in this form.
Dependencies such as <tt>Wants=</tt>, <tt>Requires=</tt>, <tt>Before=</tt>,
and <tt>After=</tt> are set in the common advanced options.</p>
<p>For a swap unit, examples include <tt>What=/swapfile</tt> and
<tt>Priority=10</tt>. For a slice unit, use the dedicated fields for
CPU weight, memory maximum, task maximum, and I/O weight; this field can be
used for additional resource controls such as <tt>CPUQuota=50%</tt> or
<tt>MemoryHigh=256M</tt>. For user units, slice resource controls apply only
within the selected user's systemd manager.</p>