Using Peios
Work with a Peios machine and manage it: the desktop and command line, accounts and security, services, configuration, networking, storage, software, and events.
Single-page view · as markdown
The Desktop
Peios / Using Peios / Desktop Basics
The Peios desktop runs in a web browser. You sign in to the machine from a browser page, and the machine shows your desktop session there: application windows, a dock, a launcher, and a top bar. The applications themselves run on the Peios machine, with the authority of the account you signed in with. Knowing which program provides each part tells you where to look when something is missing or doesn't apply.
The parts of a session #
Three programs work together in every desktop session:
- GXWI serves the session. It presents the sign-in page, asks the machine's authentication service to check your credentials, and carries the session's traffic between your browser and the machine.
- Fenestra is the compositor. It tracks the applications in the session and arranges their windows into tiles and workspaces.
- Fenesh is the shell. It provides the background, top bar, dock, launcher, and power menu, and the Desktop Settings and Get started applications.
Fenestra and Fenesh run as your account, so they can do only what your account can do. Fenestra starts whichever shell the machine is configured to use. If none is configured, Fenestra shows its own minimal taskbar and launcher instead. The Desktop Shell and The Desktop Compositor describe each program in more detail.
One session on several devices #
You can open the same session from more than one device. Some state belongs to the session, and some to each browser page:
| State | Belongs to |
|---|---|
| Open applications and their windows | The session |
| The workspace each window is on | The session |
| Window size, position, and focus | Each browser page |
| The workspace you are viewing | Each browser page |
Closing a window or moving it to another workspace therefore affects every device attached to the session. A new window opens on the workspace that was last selected on any device.
Closing a browser tab doesn't end the session. Sign in again to return to it, or use the desktop's sign-out action to end it.
Where to start #
These guides cover everyday use of the desktop:
- Using the Launcher and Dock to start applications and switch between windows.
- Arranging Windows and Workspaces to resize tiles and move between workspaces.
- Desktop Settings to change the wallpaper, clock, dock, and keyboard shortcuts.
- Everyday Applications to find the application for a file, account, or system task.
If something doesn't appear or doesn't apply, start with Troubleshooting Desktop Settings and Applications or Troubleshooting Windows and Desktop Connections.
The Desktop Shell
Peios / Using Peios / Desktop Basics
Fenesh provides the background, top bar, dock, launcher, and power menu in a Peios desktop session. GXWI serves the session, and Fenestra arranges its windows. Fenesh is the shell application inside that session.
The component includes three programs:
| Program | Role |
|---|---|
fenesh | Desktop shell surfaces and session controls |
fenesh-settings | Desktop Settings for personal choices and machine defaults |
fenesh-welcome | The Get started window with introductory desktop actions |
The shell runs as the signed-in account. Fenestra grants the configured shell its desktop role. Starting an unrelated application does not make it part of the shell. Desktop Settings and Get started are ordinary desktop applications, with the same account permissions as the session.
What the shell stores #
Fenesh stores personal wallpaper, clock format, dock pins, and the welcome marker in your registry settings. Machine defaults are separate. Deleting a personal override restores the corresponding machine default, except for the welcome marker, which enables another automatic welcome attempt.
Fenesh does not own account credentials, window tiling rules, the application catalog format, or shared keyboard-shortcut and file-opening contracts. Those belong to the components that provide them. Desktop Settings presents controls for some of those shared settings.
The Desktop Compositor
Peios / Using Peios / Desktop Basics
Fenestra arranges windows in a Peios desktop session. Its Rust process tracks applications and surfaces, while its browser page chooses each window's size, position, and focus. The same session can appear on several devices with different layouts.
GXWI starts Fenestra after sign-in and routes authenticated session traffic to it. Fenestra runs as the session account. It does not receive your password or perform the browser's sign-in authentication.
Compositor and shell #
The compositor manages surfaces; the shell provides controls such as a dock and launcher. Fenestra starts the configured shell and grants it access to desktop-wide operations. Fenesh is one shell that uses those operations. Fenestra also includes a minimal taskbar and launcher for sessions without a configured replacement.
The package contains three programs:
| Program | Role |
|---|---|
fenestra | Session compositor, application connections, and desktop page |
fenestra-taskbar | Fallback panel with a button for each window |
fenestra-launcher | Fallback application search overlay |
The fallback programs do not provide Fenesh's wallpaper settings, pinned dock, welcome application, or power menu. Choosing a shell changes those controls without replacing Fenestra's window manager.
Shared and local state #
Application surfaces and their workspace assignments belong to the session. Closing a surface or moving it to another workspace affects every device attached to that session. Window geometry, focus, dialog position, and the workspace being viewed belong to each browser page.
The workspace last selected on any device determines where a subsequent application window opens. Two devices viewing different workspaces therefore share the choice of destination for that window.
Using the Launcher and Dock
Peios / Using Peios / Desktop Basics
Use these controls inside a signed-in desktop session. Your active shortcuts appear in Get started and Desktop Settings.
Start an application #
Use the launcher to find an installed application:
- Select the Peios mark at the bottom of the dock, or press the launcher shortcut. The built-in shortcut includes Ctrl+Space.
- Type part of the application's name.
- Use the arrow keys to select a result, then press Enter. You can also select the result with the pointer.
Press Esc to close the launcher. It shows up to 12 matching applications. It reads application declarations from the system catalog, so a program needs a valid declaration to appear.
Pass simple arguments #
The launcher accepts whitespace-separated arguments after an application selector. For example, use an application ID followed by a file path that contains no spaces. The selected application's declared arguments come before the additional arguments.
If the entire input matches an application's name or ID, the launcher treats all of it as the selector. Otherwise it treats the first word as the selector and the remaining words as arguments. It does not implement shell quoting, variable expansion, pipelines, or shell commands. Use a terminal when you need those features.
Switch between windows #
The dock shows pinned applications first, followed by other running programs. Select a running program's icon to cycle through its windows, or select a window's dot to focus that window directly. With the built-in shortcut, Alt+1 through Alt+9 select the first nine dock entries.
Separate processes can have separate dock entries even when they belong to the same application. The first running instance occupies its pin; additional instances appear with other running programs. An idle pin starts the application when selected.
Use an application's menu #
Open a dock entry's context menu to see its available actions. Declared applications offer Open or New window, and pin controls. Running programs offer Close or a control to close all their windows. Closing requests are sent to the application, which decides how to handle unsaved work.
To keep an application on the dock, select Pin to the dock. Drag its pin to change its position. Select Unpin from the dock to remove it. For default and error behavior, see wallpaper, clock, and dock.
Arranging Windows and Workspaces
Peios / Using Peios / Desktop Basics
Use these controls inside a signed-in desktop session. Keyboard examples use the built-in assignments; personal or machine shortcuts can replace them.
Arrange tiled windows #
Application windows share the available desktop area. A window opening on a workspace takes part of the focused tile, and closing a tile returns its space to its neighbor.
To resize adjacent tiles:
- Find the separator between the windows.
- Drag the separator to the required position.
- Release it to keep that split on this browser page.
For keyboard operation, press Tab until the separator has focus, then use the arrow keys along its direction. The layout keeps both sides within its allowed minimum size. Resizing on one device does not resize another device's layout.
Alt+J focuses the previous tile and Alt+K focuses the next tile. On a viewport narrower than 640 pixels, only the focused tiled window appears. Side panels move to the bottom so they do not consume the narrow width.
Change workspaces #
Workspaces group windows within the session. To move between them:
- Press Ctrl+Alt+Right Arrow to select the next workspace, or Ctrl+Alt+Left Arrow to select the previous one.
- Open an application to place its window on the last selected workspace in the session.
To move the focused window and follow it, add Shift to the corresponding workspace shortcut. A dialog can also move between workspaces.
Fenestra supports up to 16 workspaces. Below that limit, an empty workspace is available after the last occupied workspace. Empty gaps collapse as windows move or close, so workspace numbers can change. The last selected workspace is retained while empty.
Use dialogs #
Dialogs float over tiled windows instead of taking a tile. You can continue using other windows while a dialog is open. To reposition one, drag its title strip. The position changes on this browser page only.
Selecting a dialog brings it in front of other dialogs. Closing it returns focus to the earlier window when that window still exists. On a narrow viewport, the dialog uses the available window width.
Inspect a window's identity #
Select the application icon in a window's title strip to show the application and process information supplied by Fenestra. Select it again to hide the information. This information comes from the connected process, rather than text supplied inside its page.
If an application page cannot cooperate with desktop keyboard handling, the strip keeps an explanatory identity label visible. Use the compositor controls or another cooperating window when a shortcut is not received inside that application.
Using the Welcome and Power Controls
Peios / Using Peios / Desktop Basics
The Get started window introduces the launcher, dock, and desktop layout. Its shortcut hints use your active assignments. Buttons to open files or a terminal appear only when the corresponding applications are installed.
Reopen the welcome window #
Use the launcher in a signed-in desktop session:
- Open the launcher from the Peios mark on the dock.
- Search for
Get started. - Select the application.
You can also select Show Again in the Dock section of Desktop Settings. That action clears the automatic welcome marker as well as attempting to open the window.
At session startup, Fenesh attempts to open Get started when the welcome application is installed and the account has no welcome marker. It writes the marker before launching. A launch failure therefore does not retry at every subsequent session. If the marker cannot be read, Fenesh skips the automatic launch; if it cannot be written, Fenesh also skips the launch.
End a session or shut down #
Save your work before using the power menu:
- Open the power menu from the top bar.
- Choose the action for your intended result.
The menu offers three actions:
- Log off ends your desktop session through the session service.
- Restart requests a machine restart from the service manager.
- Shut down requests a machine power-off from the service manager.
Restart and shutdown affect the machine, including other sessions. The service manager authorizes the request using your account; Fenesh does not bypass its policy. If the request fails or is refused, Fenesh restores the desktop and displays the error. Read that error before retrying.
Session Transitions
Peios / Using Peios / Desktop Basics
Fenestra's browser page connects the sign-in screen to the desktop and shows when a session or machine becomes unavailable. These displays communicate session state; they do not authorize a restart or prove that a machine has powered off.
Entering the desktop #
When GXWI passes its sign-in animation state to the page, Fenestra shows the arrival transition while the shell starts. Without that saved state, the page displays the desktop directly. Reduced-motion preferences shorten the movement.
The first-session greeting is selected when Fenestra creates the account's
CurrentUser\Software\Fenestra key. An existing key means the session is
not treated as the first, even if another application created the key.
A registry failure also uses the non-first-session behavior. Only the
session's first browser attachment receives the first-session flag.
The arrival display waits for shell panels and backgrounds to become ready. A shell can declare how many parts to expect. Without that count, the page uses readiness and a settling interval. A 10-second upper bound prevents the arrival display from waiting indefinitely for a broken shell. The desktop appearing after that bound is not evidence that every shell program started successfully.
Reconnecting a page #
The compositor sends a complete surface list and the active shortcut map when a page attaches. A disconnected page reconnects and receives another snapshot. A page that falls too far behind the compositor's change stream is disconnected so it can reconnect from a complete snapshot.
An application surface lasts while its application connection exists. Reconnecting a browser does not recreate a process that has exited. Raw application pages can also have browser-local state that does not survive a page reload; shared live application state belongs to the application process.
Restart, shutdown, and loss of contact #
A trusted shell can announce a restart or shutdown to every page showing its session. The page displays the departure animation and checks whether GXWI answers again. The shell remains responsible for requesting the machine operation from the service manager.
If the shell withdraws its announcement after a refusal, the page returns to the desktop and stops the outstanding availability check. Delayed callbacks from that canceled attempt cannot redirect the restored desktop or interfere with a later attempt. A shutdown message in the browser is not an independent hardware power-state check.
When a session connection closes and GXWI also stops answering, the page reports loss of contact and waits for the address to return. This can mean a machine restart, a network interruption, or another availability problem. It does not identify the cause. When the expected reconnect conditions are met, the page returns to sign-in.
Using the Fallback Taskbar and Launcher
Peios / Using Peios / Desktop Basics
Fenestra starts its companion taskbar and launcher when the machine has no valid shell override. These controls are separate from Fenesh's dock and launcher. Use this guide when your session shows the minimal taskbar.
Select a window #
The taskbar has one button per ordinary window, including its icon and title. Select the button to focus that window on your device. With the built-in shortcuts, Alt+1 through Alt+9 select the first nine buttons.
The taskbar lists windows rather than application groups. Several windows from one application therefore have separate buttons. Dialogs are not listed as ordinary windows. The taskbar does not store pinned applications.
Start an application #
Use the fallback launcher inside the desktop session:
- Press Ctrl+Space or Alt+P to show the launcher, unless your shortcuts have been changed.
- Type one word from the application's title or its application ID.
- Use the up or down arrow to select a match, then press Enter.
The launcher shows up to 12 matches. Press Esc to close it and clear the search. It reads the installed application catalog when matching or starting an application.
Supply arguments #
The first whitespace-separated word selects applications. Every remaining word becomes an additional argument after the application's declared arguments. A multiword application title is therefore not treated as one selector. Use its ID or a single matching word when supplying arguments.
The launcher does not support shell quoting, variable expansion, or pipelines. Use a terminal for commands that need those features. An application that fails to start is reported in the launcher's error output.
Change shortcuts #
The taskbar and launcher follow the session's shared shortcut settings.
The taskbar uses DockItem, and the launcher uses Launcher. Changes are
watched while the session runs.
Desktop Settings, when installed, provides the controls for personal and machine shortcuts. It is part of Fenesh, not the fallback shell. The installed Fenestra registry reference describes the stored values.
Troubleshooting Desktop Settings and Applications
Peios / Using Peios / Desktop Basics
Use the visible error message first. Fenesh also writes diagnostic messages to standard error. Where those messages are collected depends on how your desktop session was started.
A changed setting does not appear #
Check the setting and its scope before restarting anything:
- Reopen the relevant section in Desktop Settings and check whether the value was saved.
- Check for a personal override if you changed a machine default. Choose System Default for your account if you want to follow that default.
- Read any permission or save error in the settings window.
- If an immediate shell setting is saved but unchanged on the desktop, inspect the shell's error output for a failed registry watch. Start another desktop session to reread the settings.
Sign-in appearance, icon themes, and advanced settings have their own activation points. See settings for all users.
A wallpaper falls back to the embedded image #
Check that the selected path is absolute, readable by the session account, and names a supported regular image file of at most 16 MiB. Symlinks to regular files are accepted; pipes and other special files are rejected. A machine wallpaper must be readable by every intended account. A selected but unusable personal image falls back to the embedded image, not the machine image.
A supported extension does not prove that image contents can be decoded. Try a known valid image. If you replaced a file at the same path, select it again or start another session; Fenesh does not watch image files.
An application or pin is missing #
The launcher lists declared applications in the system catalog. Check that the package and its application declaration are installed. A running program without a declaration can appear on the dock but cannot be pinned or restarted from its menu.
A pin for an uninstalled application stays in your saved list and is hidden. Reinstalling that application makes the pin visible again.
A shortcut is refused #
Choose a combination that includes Ctrl, Alt, or Meta and that the browser does not reserve. If another action has that shortcut, remove the existing assignment before adding it to the intended action. A reset can also create a conflict with an override; resolve the reported conflict first.
The welcome window does not open automatically #
Search for Get started in the launcher. If it is absent, install the welcome application. If it opens manually, use Show Again in Desktop Settings to clear the marker for another automatic attempt. Check the shell's error output if reading or writing the marker fails.
Troubleshooting Windows and Desktop Connections
Peios / Using Peios / Desktop Basics
Fenestra writes failures and shell restarts to standard error. The place those messages are collected depends on how GXWI starts the session. Keep session authentication failures separate from compositor failures: GXWI owns sign-in and browser routing.
Shell controls are absent #
Check startup and configuration before repeatedly restarting the session:
- Read the session's Fenestra messages for display-socket or shell errors.
- Inspect
Machine\Software\Fenestra Shell. An empty list intentionally starts no shell; an absent value selects the fallback programs. - Check that each configured executable exists and can run as the session account. A valid but missing executable does not select the fallback.
- Correct the cause and start another desktop session.
Fenestra needs the runtime directory provided by GXWI to bind its display socket. If binding fails, it reports that applications are unavailable and does not start shell applications. A browser page appearing is therefore not enough to establish that application transport is working.
A window is missing #
Check the workspace and application before assuming data was lost:
- Move through the workspaces using your configured shortcuts.
- If the viewport is narrow, focus another tiled window with the taskbar, dock, or tile shortcut. Only one tiled window is visible at a time.
- Check whether the application process has exited or disconnected.
Moving a window from another device changes its workspace for the whole session. Window geometry and focus remain local to each device. A closed application connection removes its surfaces from every attached page.
Shortcuts do not work inside an application #
A browser can reserve a combination before the desktop receives it. Choose a different shortcut in Desktop Settings if available. An application's raw page also needs to cooperate with desktop keyboard forwarding. An explanatory label stays visible on pages that do not cooperate.
When shortcuts were edited directly, check for conflicting assignments. The window manager's claimed shortcut takes precedence over a shell claim. Among shell claims, the first claim wins. Use the settings controls to avoid introducing these conflicts.
A debug window appears unexpectedly #
The desktop page includes diagnostic key bindings when the compositor page
itself has keyboard focus. Space requests a debug surface. Enter attempts
to start gxwi-hello-app beside Fenestra; Shift+Enter requests its raw-page
mode. These are diagnostic controls, separate from the application launcher.
Focus an application window to enter ordinary application input.
The page waits for the machine #
Check whether the machine and its GXWI address are reachable from another administrative connection. A loss-of-contact display cannot distinguish a network failure from a stopped service or machine. Avoid repeating a power operation until the actual machine state is known.
Desktop Settings
Peios / Using Peios / Desktop Settings
Desktop Settings changes your wallpaper, clock, dock, keyboard shortcuts,
and default apps. Open the launcher from the Peios mark on the dock, type
desktop, and select Desktop Settings.
The window separates personal choices from machine defaults:
| Group | Sections | Scope |
|---|---|---|
| For You | Wallpaper, Clock, Dock, Keyboard Shortcuts, Default Apps | Your desktop settings |
| All Users | Sign-In Screen, Desktop, Keyboard Shortcuts, Default Apps, Advanced | Machine settings and defaults |
System Settings handles other machine settings. My Settings handles your account, including your password. Those applications are separate from Desktop Settings.
How defaults work #
For settings that support personal choices, your choice takes precedence over the machine default. Without either choice, the component uses its built-in default. System Default removes your personal override, so later changes to the machine default apply to you too.
An empty dock or a shortcut action with no keys is an explicit choice. It does not mean System Default. An unreadable wallpaper has different fallback behavior; see wallpaper, clock, and dock.
Permission to change settings #
Desktop Settings runs as your account. The registry decides which settings you can change. Machine settings are normally writable by Administrators; controls that your account cannot use show the reason. Desktop Settings does not request elevated access or change your account's permissions.
The window refreshes stored settings every four seconds. It keeps text that you are editing rather than replacing it with an external change. A successful save is reported at the bottom of the window. Some machine settings take effect at the next desktop session or GXWI restart.
Choose a task #
Use the following guides for each group of settings:
Changing the Wallpaper, Clock, and Dock
Peios / Using Peios / Desktop Settings
Open Desktop Settings in a signed-in desktop session. The sections under For You affect your account; machine defaults continue to apply until you make a personal choice.
Wallpaper #
Choose a supplied picture or a file that your account can read:
- Select Wallpaper under For You.
- Select a picture in the gallery. To use another file, select Choose Picture…, find the image, and confirm the file selection.
- Check that the background changes. If saving fails, read the message at the bottom of Desktop Settings.
Supported file extensions are PNG, JPEG, SVG, WebP, AVIF, and GIF. The maximum size is 16 MiB. The choice stores a path, so keep the image at that path. A readable file with an image extension still needs valid image contents for the browser to display it.
Select System Default to remove your override. Fenesh then selects the machine wallpaper, or its embedded Strata image if no machine path is set. If a selected path is invalid or unreadable, Fenesh displays the embedded image; an invalid personal path does not select the machine path.
Changing the file alone does not trigger a desktop refresh. Choose the picture again or start another desktop session after replacing its contents. Avoid relying on a same-path replacement for immediate updates.
Clock #
The top bar uses the machine's time zone. To change the hour format:
- Select Clock under For You.
- Set Time Format to 24-Hour (14:05) or 12-Hour (2:05 PM).
- Check the clock in the top bar. The selection applies without an additional save step.
System Default uses the machine's format, which falls back to 24-hour time. Changing the hour format does not change the time zone.
Dock #
Use the dock or launcher to change pinned applications:
- Open an application's context menu and select Pin to the dock or Unpin from the dock.
- Drag a pinned application along the dock to change its position.
- Check the dock. If a registry write fails, the dock keeps the saved list and displays an error indicator above the launcher button.
Your first change copies the effective machine list into your personal settings and applies the change. Later machine defaults do not replace that list. Pins for uninstalled applications are hidden and retained; they return when the application is installed again.
To restore the machine list, select Dock under For You, then Use System Default. This removes your personal list. Removing every pin individually instead keeps an explicitly empty personal list.
Open the welcome window #
In Dock, find Get Started and select Show Again. If the welcome application is installed, it opens with your active keyboard shortcuts. This action also clears the first-session marker, allowing Fenesh to open the window at your next desktop session. It does not reset other settings.
Assigning Keyboard Shortcuts
Peios / Using Peios / Desktop Settings
Desktop shortcuts work across application windows, including text fields. Open Desktop Settings and select Keyboard Shortcuts under For You to change your choices.
Assign a shortcut #
Each action can have several shortcuts or none. To add one:
- Find the action and select + Add or + Set.
- Hold Ctrl, Alt, or Meta and press the other key in the combination.
- Check the displayed shortcut. If it conflicts with another action, remove that assignment first and try again.
Press Esc or select elsewhere to cancel recording. A modifier pressed alone does not complete the recording. Browser-reserved shortcuts cannot be assigned to the desktop; choose another combination if it is refused.
For Open Dock Item, select Change, hold your chosen modifiers, and press a number from 1 to 9. The modifiers apply to all nine positions. For example, Alt selects dock items with Alt+1 through Alt+9.
Remove or reset shortcuts #
Use the action's controls to change its assignments:
- Select × beside a shortcut to remove it. Removing every shortcut disables that action's keyboard binding for your account.
- Select Reset to restore one action's System Default.
- Select Reset All to System Default to remove your personal overrides.
Changes apply to your desktop session as they are saved. A reset can be refused if the restored combination conflicts with another assignment. Resolve the reported conflict and retry. If a reset of several actions fails partway through, review the displayed assignments before retrying.
Administrators can set machine defaults under All Users. See settings for all users.
Choosing Default Apps
Peios / Using Peios / Desktop Settings
Default apps determine which application opens a type of file when the application opening it uses Peios' default-app selection. Desktop Settings lets you choose among installed applications that declare support for the type.
To choose your default:
- Open Desktop Settings.
- Select Default Apps under For You.
- Find the file type and select an application from its list.
- Open a file of that type from a desktop application that uses the shared default-app selection, such as Gexora, to check the result.
The choice is saved when you select it. System Default removes your personal choice and restores the machine or built-in selection. Choosing an application does not give it support for additional file formats.
The section lists declared types with at least one available application. No Choices means there are no types to display. Install an application that declares support for the type before expecting it to appear in the selection.
For machine defaults, use Default Apps under All Users. The First Available choice removes the machine's override for that type. Personal choices continue to take precedence over machine defaults.
Setting Defaults for All Users
Peios / Using Peios / Desktop Settings
The All Users sections of Desktop Settings affect machine settings or defaults for accounts that have no personal override. You need permission to write the relevant registry keys. The application displays a reason when your account cannot change a setting.
Sign-in screen #
To change the name or notice displayed before sign-in:
- Select Sign-In Screen under All Users.
- Enter Machine Name and select Apply, or select Change… beside Notice, edit the text, and select Save.
- Check the save result. The changes take effect when GXWI next starts.
The displayed machine name is separate from the network hostname. It accepts up to 64 characters. The notice accepts up to eight paragraphs and 2,000 characters in total, with paragraphs separated by blank lines.
Desktop #
To set defaults for other accounts:
- Select Desktop under All Users.
- Choose a wallpaper or Time Format. For a custom wallpaper, select a
file readable by every intended account, such as an installed file
under
/usr/share. - To make your effective dock list the machine default, select Use My Pins beside Pinned Apps.
- Check the save result and a session without personal overrides.
These defaults do not replace existing personal choices. Wallpaper and clock changes reach active Fenesh sessions through registry notifications. A failed notification watch is reported in the shell's error output; start another desktop session if a saved change does not appear.
To choose icon themes, select Change… beside Icon Themes, enter one
installed theme folder name per line, and select Save. Folder names
come from /usr/share/icons, in preference order. The base theme is the
final fallback. Theme changes apply to new desktop sessions.
Keyboard shortcuts and default apps #
The Keyboard Shortcuts and Default Apps sections use the same controls as the personal sections. Reset All to Built-In removes machine shortcut overrides. First Available removes a machine default application for a file type. Accounts with personal overrides retain them.
See keyboard shortcuts and default apps for the controls.
Advanced #
Advanced settings select the programs that provide the desktop and the address that serves it. Keep an independent administrative way to recover configuration before changing them. An overlay can prevent access to both sign-in and the desktop.
To apply a change:
- Select Advanced under All Users.
- Edit the fields you need. Leave a field empty to remove its override.
- Select Review Changes… and read the consequences shown.
- Select Apply Changes to save, or Cancel to return to editing.
- Check the result message and the affected settings before restarting GXWI or starting another desktop session.
The fields have different operational consequences:
| Field | What to consider |
|---|---|
| Listen Address | Use an IP address and port. A changed address applies when GXWI next starts and can disconnect existing pages. |
| Compositor | Use the absolute path of a trusted program that runs as each desktop user. |
| Shell | Enter trusted shell program paths separated by spaces. Paths containing spaces cannot be represented in this field. |
| Overlay | Select a trusted program shown instead of sign-in. While enabled, normal desktop sign-in is unavailable. |
| Overlay Account | Specify the account under which the overlay runs. |
Shell programs can observe desktop windows, start applications, and receive desktop shortcuts. Permission to replace these programs is a security-sensitive capability. The review prompt does not grant it.
Advanced changes span more than one registry key. If saving fails after one key is written, earlier changes can remain applied. Review every field and correct the partial change before restarting affected services.
Essential Desktop Applications
Peios / Using Peios / Everyday Applications
GXWI Essentials is a suite of desktop applications for everyday work and system administration. Each application is installed separately. They run inside your GXWI session and use your account's access rights; opening an administration window does not give it additional authority.
The suite supplies applications, not the desktop compositor or shell. Fenesh and Fenestra provide separate desktop interfaces. Their launchers can open the applications installed on the machine.
Choosing an application #
Use the application whose scope matches the task:
| Task | Application |
|---|---|
| Browse, copy, move, or remove files | File Explorer |
| Edit a small text file | Text Editor |
| Run a shell or terminal program | Terminal |
| Inspect running processes and sessions | Task Manager |
| Control or define a service | Services Manager |
| Inspect disks and mounts | Disk Manager |
| Configure interfaces, name resolution, or firewall rules | Network Manager |
| Inspect registry keys and values | Registry Editor |
| Change machine time, locale, startup, or name | System Settings |
| Install, update, or remove packages | Package Manager |
| Enable or disable installed feature definitions | Feature Manager |
| Upgrade the Peios release | Upgrade Peios |
| Change your own account settings | My Settings |
| Administer local users, groups, and privileges | Principals Manager |
| Manage certificate trust | Security Policy |
| Read events, logs, and metrics | Event Viewer |
The file dialog and permissions editor are shared dialogs opened by these applications. They are not standalone launcher tasks.
Reading an outcome #
A displayed setting is not proof that its consuming service accepted it. After a change, read the application's result and check the affected service, file, or connection. A disabled control or incomplete view can mean access was refused; it does not mean the underlying object is absent.
Two interfaces have explicit implementation limits. Disk Manager's change forms do not modify storage. Network Manager marks several firewall activity displays as Example data. Their guides describe what remains real and what needs separate verification.
The command manuals use the executable names gxwi-file-explorer,
gxwi-text-editor, and gxwi-terminal, alongside the other gxwi-*
application names.
File Explorer
Peios / Using Peios / Everyday Applications
File Explorer shows a directory and opens its contents with the installed applications. A window owns its current directory, selection, and sort order. Devices showing the same session window see that shared state; open another window to browse a different location independently.
Opening an entry #
Opening a folder navigates into it. Opening an executable starts it. Other files use an application that declares support for their file type: your default takes precedence over the machine default, then the available candidates are ordered by title. The entry menu lets you choose another candidate.
The listing identifies file types from their names without reading every file. When an unknown type is opened, File Explorer can check whether its contents are text. This probe reads at most 4 KiB from a regular file; it does not wait for data from a pipe or device. A directory's menu offers applications that open directories, including Terminal when it is installed.
A directory listing displays at most 2,000 entries and reports when the limit is reached. An incomplete listing is not evidence that an omitted file is absent.
Copying and moving #
Cut and copy select an entry for a later paste. That selection is shared between File Explorer windows through the session runtime directory. Without that directory, the selection belongs to one window.
Pasting a copy under an occupied name chooses a copy name. Pasting a cut entry does not overwrite an existing name; the entry remains selected for a later move. Copying a directory includes its contents and runs while the window continues to respond.
Removal and permissions #
Delete asks for confirmation and removes the entry. A directory is removed with its contents. There is no trash or undo store, so preserve anything you need before confirming.
Permissions opens the shared descriptor editor. File Explorer retains
a handle to the selected object so applying a descriptor targets that
object even if its name changes. The dialog does not supply extra rights.
It offers the access list and the owner for editing as the kernel allows,
found by opening the object for the right to change each one alone. Those
opens read nothing and never conflict with other programs' opens. Where
the kernel cannot say, as for a device or pipe, both are offered and the
kernel decides when you apply. See The Permissions Editor and
gxwi-file-explorer(1).
Names that are not UTF-8 #
A filename that cannot be displayed as UTF-8 uses replacement characters in the listing. Local navigation, rename, and deletion retain the original filename bytes, so identical-looking labels do not identify the same entry. The shared clipboard accepts only UTF-8 paths and reports other paths as unsupported rather than silently changing their names.
Filenames and launching applications #
File Explorer keeps the original filename when selecting or changing a file. The application launch protocol carries UTF-8 text. If a filename cannot be represented as UTF-8, File Explorer reports that it cannot open the file through another application. It does not change the filename or launch a different file. The same check applies when opening a terminal in a folder.
Managing Files
Peios / Using Peios / Everyday Applications
Use File Explorer to organize files within the access your account has. Copying keeps the original; cutting and pasting moves it. Deleting removes it without a trash folder.
Before you start #
You need File Explorer in a running GXWI desktop and access to the source and destination directories. Keep a separate copy before deleting data you might need again.
Copy or move an entry #
- Open File Explorer from the launcher and navigate to the source directory.
- Open the entry's context menu and choose Copy or Cut.
- Open the destination directory in this or another File Explorer window. Open the directory's context menu and choose Paste.
- Wait for the operation's result before starting another operation on the same entry.
Check the result #
Inspect the destination entry and open it when appropriate. A copy leaves the source intact; a successful move removes it from the old directory. If a cut name is already occupied, choose a different destination or rename an entry after reviewing what is there.
Rename or delete #
Select Rename from an entry's context menu and enter an unused name. File Explorer refuses an occupied destination instead of replacing it.
For deletion, review the selected entry, choose Delete, and read the confirmation. Confirm only the intended entry and subtree. Check the listing afterward; a refusal means the operation did not complete as requested and needs review, not repeated confirmation without inspection.
Use the directory context menu to create a new folder or file. Its name
must identify a new entry. The manual gxwi-file-explorer(1) describes
launch arguments and listing limits.
Editing Text Files
Peios / Using Peios / Everyday Applications
Text Editor edits one file per window. Unsaved text belongs to the application window, so reconnecting a browser does not discard it. Closing the application window asks about unsaved changes.
Before you start #
You need Text Editor in your GXWI session and permission to read the file. The editor accepts UTF-8 text without NUL bytes, up to 349,525 bytes. Use a tool suited to larger or binary files when a file exceeds those limits.
Edit and save #
- Open a text file from File Explorer, or start Text Editor for a new document.
- Make the intended change. Press Ctrl+S to save. A new document asks for a name when first saved.
- To save under another name, press Ctrl+Shift+S and choose an unused name. This operation does not overwrite an existing file.
Check the result #
Read the result shown by the editor and confirm that the document has no unsaved changes. Saving an existing file writes it in place, preserving its identity rather than replacing it with another file. Uniform CRLF line endings are preserved; mixed endings are written as LF.
Changes made elsewhere #
The editor checks the file every two seconds. If another program changes it while your buffer is unchanged, the editor reloads it. If both versions changed, it asks which to keep. Read both the conflict and the file's purpose before discarding either version.
Saving in place is not an atomic replacement transaction. Keep a backup
when editing a file whose previous contents need to remain recoverable.
See gxwi-text-editor(1) for the supported input and shortcuts.
Using a Terminal
Peios / Using Peios / Everyday Applications
Terminal runs a shell or another program on a pseudoterminal inside the desktop. The running terminal belongs to the application, so a browser reconnection shows the terminal state that remains on the machine.
Before you start #
You need Terminal installed and a running GXWI session. Commands run with your account's permissions and can change files or system settings within those permissions.
Open and use the terminal #
- Open Terminal from the launcher. It starts your configured absolute
shell path, or
/bin/sh, in your home directory. - Enter a command and press Enter. Programs that need a desktop connection inherit the session environment.
- Use Ctrl+Shift+C to copy selected text and Ctrl+Shift+V or Shift+Insert to paste.
Check the result #
Read the program's output and exit status as you would in another terminal. Ending the shell closes its window. Closing the application window hangs up the terminal, which can terminate work still running in it. Closing a browser page is a different operation from closing the application window.
To open a shell in a folder, use the folder's application menu in File
Explorer. The command interface also accepts one absolute directory path,
or a program followed by its arguments; see gxwi-terminal(1).
The desktop retains its own keyboard shortcuts while the terminal has focus. A shortcut reserved by the desktop does not become input to the terminal program.
When input waits #
Terminal keeps up to 1 MiB of pending input in each browser page. It sends that input in order as the running program accepts it. If the buffer fills, typing pauses while the program catches up; its output continues to appear. A paste that does not fit the remaining space is refused in full with a message. Wait for the program to read, or paste a smaller amount.
If the connection breaks with input pending, Terminal warns that some input might already have reached the program. It does not replay that input after reconnecting, because replaying a command could run it twice. Input already received by the application might still reach the program. Check the output before deciding what to type again. The warning remains after reconnection until you start entering new input.
The File Dialog
Peios / Using Peios / Everyday Applications
The shared file dialog lets an application ask you for a file to open, a name to save, or a folder. The dialog chooses a path; the calling application opens, writes, or uses that path. A successful selection does not grant the caller new filesystem rights.
The dialog shows folders first and filters files by the kind the caller requested. Up, Home, and the path field change the location. Hidden files includes names beginning with a dot. In save mode, the selected kind can supply a missing extension, and an occupied name asks for confirmation.
An application that asks for a folder gets a dialog that shows folders only. Choose Folder chooses the folder you picked or, with nothing picked, the folder you are in; the dialog shows which path it will choose before you press it. Only an application that asks for a folder can be given one: opening and saving never return a folder, and opening one goes into it instead.
The dialog can also create a folder, rename an entry, or delete it. Deletion is real: a directory goes with its contents. The dialog runs as you and disables operations it cannot perform.
Canceling, pressing Esc, or closing the dialog reports cancellation to the caller. The dialog also ends when its caller closes the input channel. It is not meant to be started as a standalone launcher task.
Developers use the file-choosing protocol or the companion Rust client.
The protocol's shared contract belongs to the Peios userspace
specifications; this suite owns the dialog implementation. See
gxwi-file-dialog(1) for transport and lifecycle details.
The selection protocol returns a UTF-8 path. A path that cannot be represented as UTF-8 is refused explicitly and leaves the dialog open. Local operations still identify the original entry independently of its displayed label. Rename refuses an occupied destination, including one created after the dialog's initial check.
GXWI Service
Peios / Using Peios / The Desktop Service
The Graphical Extensible Web Interface (GXWI) provides browser access to Peios desktop sessions. It handles TLS, authentication conversations, session connections, and installation or setup overlays. The compositor and desktop shell are separate programs.
Service and desktop responsibilities #
The programs divide responsibility as follows:
| Program | Responsibility |
|---|---|
gxwid | Machine identity, privileged setup, and session lifetime |
gxwi-server | Restricted network-facing HTTP and TLS worker |
| Configured compositor | Desktop presentation and application surfaces |
| Desktop shell | Panels, launchers, settings, and other desktop tools |
Fenestra is a compositor. Fenesh is a desktop shell. GXWI does not require
those names in its protocol; the configured compositor determines the
session program. gxwi-hello provides a diagnostic session when no
compositor is configured.
Authentication and authority #
GXWI asks authd to authenticate an account for a Remote Interactive logon. The resulting access token controls the desktop job. Applications inherit session authority unless another explicit mechanism changes it.
Rendering a button does not grant permission to perform its action. The service or kernel handling an operation still checks access. A disabled button is a usability choice, not an authorization boundary.
Persistent sessions #
A session can continue after browser connections disappear. A later successful sign-in can reconnect to the same running session. Session persistence is not disk persistence: restarting a compositor or ending its job loses process state that applications have not saved.
The service keeps normal sessions separate from machine overlays.
Configuring the GXWI Service
Peios / Using Peios / The Desktop Service
Configure GXWI through Machine\Software\GXWI. The registry's access
checks determine who can change these values. The complete types,
defaults, and validation rules are in regman for that path.
Before you start #
Use an account with write access to the required registry values. Keep a trusted console available when changing remote access. A failed listener or compositor change can prevent browser access.
Change the listener #
- Set
Listento the numeric address and port to bind, such as127.0.0.1:7780for local access. Hostnames are not accepted. - If other machines need access, configure the corresponding network
policy under
Machine\System\Network\Rules\Flow. - Restart the
gxwidservice to apply the listener change. - Verify that the configured address accepts HTTPS and presents the expected certificate before entering credentials.
Changing the listener does not add a name or address to the certificate. Verify both reachability and certificate identity.
Choose the compositor #
- Set
Compositorto the absolute path of the session program. - Start a separate test session to verify that the program can start and serve a desktop.
- End and reopen existing sessions when they need the changed compositor.
The value applies to sessions created after the change. A missing executable fails session startup; GXWI does not validate program availability when the registry value is written.
Anyone who can change Compositor chooses a program that runs with the
authority of users who start sessions. Protect this value as carefully as
the executable itself.
Set public labels #
Under Machine\Software\GXWI\Logon, Name supplies a machine label and
Notice supplies paragraphs displayed before authentication. Restart
gxwid to apply changes. Both are plain text and visible to anyone who
can reach the service. Do not put secrets in them.
Machine Overlays
Peios / Using Peios / The Desktop Service
A GXWI overlay replaces normal browser sign-in and desktop access with one shared program. Installation and first-boot setup can use this mechanism. An overlay is separate from an application overlay surface inside a desktop.
Shared authority #
OverlaySession under Machine\Software\GXWI names the program.
OverlayUsername names its account. GXWI requests a credential-free
Remote Interactive logon for that account. authd must permit that logon;
GXWI does not bypass an account's credential requirement.
Everyone who reaches the service shares the overlay program and its account authority. Choose an account with only the rights the setup program needs. Browser visitors do not authenticate individually before using it.
Write access to either registry value therefore controls a public program and the authority it receives. Protect both values and the executable.
Activation and failure #
GXWI watches the configuration. Setting an overlay starts it. Changing its
program or account replaces it. Removing OverlaySession restores normal
sign-in and access to existing sessions.
Normal desktop sessions continue behind the overlay but cannot be reached through the browser while it is active. The overlay has its own job, socket, and runtime directory.
If a configured overlay cannot start, GXWI shows a not-ready page and retries. The delay increases from 1 second to at most 30 seconds. It does not expose normal sign-in as a fallback. Read the service log to identify an unavailable program, missing account, or refused credential-free logon.
An invalidly typed or malformed registry value is rejected according to
the setting's validation rules. Read regman for the distinction between
invalid configuration and a valid program path that cannot run.
Reconnection and the Waiting Page
Peios / Using Peios / The Desktop Service
A browser connection and a desktop session have different lifetimes. Losing network access does not save or end applications. Reconnection works only while the relevant service, session, and application state remain available.
The waiting page #
GXWI supplies a service worker at /.gxwi/sw.js. When browser policy
permits registration, it caches the waiting page and that page's assets.
It does not cache ordinary application content as an offline desktop.
Requests marked cache: "no-store" bypass its interception. Cache cleanup
removes only obsolete GXWI waiting-page caches, preserving unrelated caches.
A failed navigation or a navigation taking more than 10 seconds can show the waiting page. A navigation timeout aborts the underlying fetch rather than leaving it running. Caller cancellation remains cancellation. The page checks for the machine every 1.5 seconds and returns when it can reach it. A browser that cannot register the service worker can show its own network error instead.
Trust the machine's certificate through the browser's supported controls. An exception at a certificate warning does not guarantee that the service worker can run.
Worker and session recovery #
gxwid retains the listening socket when gxwi-server restarts. This
allows connections to queue while the worker is unavailable, within the
operating system's backlog limits. It does not guarantee that every client
request survives a restart.
The privileged daemon retains session jobs independently of the network worker. A browser might need to authenticate again after worker state is lost. Reconnecting to a surviving session differs from restoring a stopped application.
Diagnose a failed connection #
Check the failure in order:
- Confirm that the machine is reachable at the configured address and port.
- Verify the certificate through a trusted console.
- Check the
gxwidservice log for worker, authentication, or compositor startup failures. - Check whether a machine overlay intentionally hides normal sessions.
- Verify that the compositor and application processes remain running.
Certificate Identity and Renewal
Peios / Using Peios / The Desktop Service
GXWI keeps a private key and a certificate in /var/state/gxwi. The private
key identifies the machine cryptographically. A renewed certificate uses
the same key but has a different fingerprint.
Stored identity #
The identity files have different access requirements:
| File | Purpose | Intended read access |
|---|---|---|
key.pem | Private ECDSA P-256 key | SYSTEM |
certificate.pem | Public certificate | Everyone |
certificate.sha256 | Public SHA-256 fingerprint | Everyone |
Protect the private key when backing up or restoring machine state. Sharing one key between machines also shares their cryptographic identity. GXWI does not silently replace an unreadable key; startup fails instead.
Renewal #
A generated certificate starts 1 day before creation and expires 1 year after creation. GXWI checks certificates at startup, every 24 hours, and on service reload. It renews a certificate with fewer than 30 days left. It also replaces certificates outside the accepted lifetime policy.
Renewal uses the machine's hostname at that time. Renaming the machine does not itself renew an otherwise acceptable certificate.
An authorized operator can request the reload check with:
This requests the normal check; it does not force renewal of an otherwise acceptable certificate or end existing desktop sessions.
Existing TLS connections continue. Subsequent connections receive the replacement certificate. A browser that trusted the preceding certificate can require verification and import again. See Verifying the Machine's Certificate.
Renewal records #
The event gxwid.certificate.renewed records the preceding fingerprint,
the replacement fingerprint, and the certificate subject. Consult
evman gxwid.certificate.renewed for its fields. Initial certificate
creation is distinct from renewal.
A renewal record identifies the certificate change; it does not prove that a browser has imported the replacement. Use the trusted fingerprint file when verifying a connection.
Browser policy #
GXWI does not send a Strict-Transport-Security header. HTTPS remains the
only transport for desktop content. Browser name, expiry, and trust checks
still apply.
Configuring the Session Shell
Peios / Using Peios / The Desktop Service
The machine's shell setting controls which programs Fenestra starts for every desktop session. Shell programs receive desktop-wide capabilities, so choose trusted programs and preserve an independent administrative way to recover a broken configuration.
Choose shell programs #
Before changing the configuration, install the intended programs and confirm that your account can write the machine's Fenestra settings. Desktop Settings provides an Advanced section when Fenesh is installed.
To change the shell with the Registry Editor:
- Open
Machine\Software\Fenestra. - Set
Shellto aREG_MULTI_SZcontaining the absolute path of each shell program. Use a separate entry for each program. - Start another desktop session and check that the expected controls appear. Existing sessions keep their shell selection.
The list accepts up to 16 programs. Entries are executable paths, not
commands with arguments. One invalid relative path invalidates the whole
value. An absent, unreadable, or mistyped value selects the companion
fenestra-taskbar and fenestra-launcher beside the compositor executable.
An explicitly empty list starts no shell. It does not restore the default. Delete the value to restore the fallback programs. A valid path whose program cannot start is reported; Fenestra does not replace that entry with a fallback program.
Understand the authority granted #
Configured shell processes receive the surface list and can ask Fenestra to start programs, close another application's surfaces, or end the session. Their browser surfaces can control focus, overlays, and global shortcuts. Shell programs retain the session account's operating-system permissions; their desktop role does not make them administrators.
Fenestra identifies a shell connection from a tracked child process and
kernel-reported peer identity. A surface title, role, or application name
does not grant that role. Protect write access to the machine's Shell
value as carefully as access to the selected executables.
Restart behavior #
Fenestra restarts a shell program after it exits, with a 1-second delay. It stops retrying after three consecutive runs shorter than 5 seconds. A run lasting at least 5 seconds resets that consecutive-failure count. A failure to start the executable stops that program's supervisor without retrying.
Correct the program or configuration, then start another desktop session after the supervisor has stopped. Configuration changes are read at session startup rather than while a supervisor is running.
Icons and keyboard shortcuts #
Fenestra reads the shared icon-theme chain at session startup and serves icons for desktop pages. Changes to the chain apply to another session. The base theme remains the final fallback. The detailed icon contract belongs to the Peios General System Standards, rather than this guide.
Keyboard shortcuts use personal overrides, then machine overrides, then built-in defaults. An empty value turns off an action's shortcut; removing the value restores its fallback. Fenestra watches shortcuts while running. The installed registry reference lists the actions and accepted values.
Working with Text and Archives
Peios / Using Peios / Command-Line Basics
Install the tools needed for the task. Package availability in the system root does not imply availability in an initramfs.
Inspect and compare #
Use grep for matching lines, sed for line transformations, awk or gawk
for fields and records, and find with xargs for selecting files and
passing
arguments. diff, cmp, diff3, and sdiff compare contents. Peiosutils
supplies basic tools including cat, head, tail, cut, paste, join,
sort, uniq, tr, and wc.
In less, Space advances, b goes back, /pattern searches, n repeats the
search, and q quits. Its edit command needs a separately installed editor.
For terminal editing and its save/recovery rules, see
Editing With nano.
Create, inspect, and extract #
-
Choose a format supported by the recipient and install its compressor command as well as the archive tool. A compression library alone does not provide the executable GNU tar invokes.
-
Create and inspect an archive:
-
Extract into a fresh directory and inspect the resulting contents:
GNU tar's -a selects compression by suffix, such as .tar.gz, .tar.xz,
.tar.zst, or .tar.bz2. The associated commands are gzip, XZ, Zstandard,
and bzip2. file ARCHIVE identifies contents independently of the name.
For ZIP exchange, use zip -r documents.zip documents/, inspect with
unzip -l documents.zip, then extract with
unzip documents.zip -d restored-zip.
These formats carry conventional metadata and contents, not a complete
Peios
backup of native security descriptors and registry state.
Editing with Nano
Peios / Using Peios / Command-Line Basics
The org.gnu.nano package supplies nano and rnano. Its common package
supplies
syntax definitions, translations, and manuals. The vendor nanorc enables
bundled syntax definitions. HOME and XDG data conventions select user state.
Edit and check a document #
- Open
nano path/to/file. Use Ctrl+G for help. - Edit the intended buffer. Ctrl+O writes it; Enter confirms the filename.
- Confirm the write succeeded before Ctrl+X exits. Check the saved contents when recovery or an external writer makes the result uncertain.
An existing regular file is written in place. Its owner, DACL, audit policy, and integrity label remain, and hardlinks still refer to that object. This is not atomic replacement or a guarantee against interrupted storage writes. New documents use destination inheritance. FACS controls access; numeric root and Unix modes do not grant permission. Saving does not itself require permission to rewrite the descriptor, while synchronization needs its applicable handle right.
Choose backup and recovery behavior #
nano --backup file requests a backup, normally file~. Backups, emergency
.save files, and formatter/speller scratch files are private to the
effective token's user SID before contents are written. They do not clone
the document's sharing policy or ownership. Normal mandatory and audit
controls still apply.
On a hangup or fatal error nano attempts an emergency save and reports its
path on success. Space, directory authority, and private-creation failures
can prevent it. There is no fallback to Unix 0600. If backup fails, the
prompt lets the user decide whether to save the original without a backup;
do not mistake that choice for a successful recovery copy.
History and lock files #
Search/replace/command history and cursor-position history are optional,
selected by --historylog and --positionlog. nano uses a suitable existing
~/.nano or its XDG/default local-data directory. Its private state policy
must already hold for existing files and directories. It validates opened
files and refuses symlinks, multiple hardlinks, and incompatible policy
rather than silently changing permissions. A history error disables the
affected operation without disabling ordinary editing.
Advisory lock files use nano's interoperable format and normal inheritance. They expose editing identity/path metadata, not buffer contents, and do not authorize access. rnano's restricted editing mode also grants no new native authority.
Choosing Session Locales
Peios / Using Peios / Command-Line Basics
A locale controls character handling, sorting, and regional formats such as dates and numbers. It is separate from a console keyboard layout, console font, or the desktop clock's 12-hour or 24-hour display preference.
Before you start #
Install the locale data needed by the intended sessions. locale -a lists
available locales when the locale tools are installed. Installing language
data does not select it. The Peios session resolver falls back to C.UTF-8;
a minimal image must supply its locale data for that fallback to work.
Choose the scope: machine defaults affect users without an override, while personal preferences affect one account. You need write access to the chosen registry key and destination layer. Record the old values before changing individual format categories.
Select and verify a locale #
-
For personal preferences, open My Settings and choose Language & Formats. For machine defaults, use System Settings, Language & Keyboard.
-
Choose an installed language and the desired formats. Read the saved outcome. The forms write the language and their format categories together; use the registry interface for a change to only one category.
-
Keep existing work safe, then start a new session through the intended client. Rejoining an existing browser session does not refresh its process environments.
-
Inspect that new session:
Check the selected language, character set, and category values, not only the saved registry fields. An application can make its own locale choice.
Category precedence #
Machine preferences live under Machine\System\Locale; account
preferences live under Users\<SID>\Locale. Read those keys' registry
manuals for supported values and types. authd prepares the private user root
at sign-in; it does not replace an existing root's descriptor.
A valid personal value overrides the same machine value. Categories without
an explicit value use LANG. Changing personal LANG alone does not remove
a machine category override. For example, a machine LC_NUMERIC can keep its
number format even when the account selects another language.
System Default removes a personal language override. Match Language removes personal format overrides, so machine category overrides can still apply. To select one installed locale for language and all categories handled by the form, select it explicitly in both lists.
Wrong types, malformed names, and unavailable locale data are diagnosed and
ignored, leaving the preceding valid default. A locale name is not a path.
LC_ALL, LANGUAGE, and LOCPATH are not stored session preferences.
For a one-command override, an environment setting such as LC_ALL=C can
still be appropriate.
Client and service boundaries #
Console sign-in and new GXWI sessions clear inherited locale overrides before
applying registry preferences. Console login -p refreshes locale even while
preserving other environment values.
SSH applies the registry preferences as defaults. Explicit environment entries
permitted by SSH configuration, user environment files, or administrator
SetEnv settings can override them for that session. Check the effective
result through the actual SSH route.
These settings do not rewrite running process environments or become peinit's global service environment. Services need their own documented configuration.
Configuring Console Keyboards and Fonts
Peios / Using Peios / Command-Line Basics
The kbd tools operate on Linux virtual consoles such as /dev/tty1. They do
not change an SSH client's keyboard, a serial terminal, or the browser's
layout. Install org.kernel.kbd and its matching common data package;
keymaps and fonts live under /usr/share/kbd.
Inspect and apply #
-
To parse an installed layout without changing the console, generate a binary map:
loadkeys --bkeymap uk > uk.bmap. -
With authority for the console operation, apply the intended map:
-
Verify typing at the machine's text console. A map can affect other virtual consoles; a device selection is not a per-session layout promise.
setfont -C /dev/tty1 Lat2-Terminus16 loads an installed font when permitted.
dumpkeys inspects the map, kbd_mode inspects or changes keyboard mode,
fgconsole identifies the active console, and chvt switches consoles.
Switching is neither authentication nor creation of a logon session.
Store a boot preference #
The console-keymap service reads the Keymap name under
Machine\System\Console. A name selects installed data, never an arbitrary
path. With the registry and service-control rights, adapt:
System Settings offers the corresponding Console Keyboard layout selection and requests a restart when available and permitted. A custom image without the service does not acquire a loader by storing a value. A configured boot-triggered service can apply the choice at next boot when an immediate restart is unavailable. An absent value leaves the built-in US layout; an invalid map leaves the existing layout and produces a diagnostic.
Inspect service status/output and verify actual console input. A saved value or accepted restart request does not establish that loading finished. Font persistence requires separate configuration. Installing kbd alone neither applies its service seed nor starts additional sign-in prompts.
Launch and package boundaries #
openvt launches with the caller's token and the existing console descriptor;
it does not authenticate or grant identity. Its upstream --user mode is
rejected on Peios. Use the managed console sign-in
services for that purpose.
The PAM-based vlock locker and optional XKB conversion are excluded from the
recipe. Debug and source packages do not configure the console.
Choosing a Message Language
Peios / Using Peios / Command-Line Basics
Peiosutils can display help and diagnostics in different languages. You can choose a language for one command without changing the environment of your shell or other applications.
Before you start #
- Install the matching
peiosutils-commonpackage with the utilities. It supplies translated messages, including the shared usage and error text. - Use a command with translations for your chosen language. Coverage varies between commands; missing messages fall back to English.
Choose a language #
-
Set
LANGfor the command you want to run. For example, read the help forsortin French: -
To read the same help in English, select the English locale:
These assignments apply to the command launched by env. Your shell keeps
its existing environment. See env(1) for other ways to control a command's
environment.
Check the result #
The French help includes Utilisation:; the English help includes Usage:.
Both should show readable usage text rather than an internal message name
such as common-usage.
If the command remains in English, check that its translation is installed.
A missing or unsupported language falls back to English. The shared message
loader reads LANG; other locale-sensitive operations can use additional
locale settings. Changing the language of help does not establish the
sorting or numeric-formatting rules for every command.
Processes and Threads
Peios / Using Peios / Processes
A process groups a program's memory and resources. Its threads execute the work, sharing that process's address space and normally its open-resource table. Threads still have their own execution state, and a thread can impersonate a different principal while handling a request.
Use Task Manager to inspect running processes. Identify the command, owner, parent, and managing service or job; those answer different questions.
Identity across creation and program replacement #
A PID identifies a process while it exists and can later be reused. The Process GUID identifies that particular process across its lifetime and in historical records. Neither identifies the principal acting through it.
A fork creates a child with a new PID and Process GUID. Private memory starts from the parent's contents, while inherited descriptors can still refer to the same open resources. The kernel's token lifecycle defines identity inheritance, including the distinction between primary and impersonation tokens. Do not infer all inherited authority from a displayed account name.
Exec replaces the running program within a process. Its PID and Process GUID remain, but the executable and its signature-derived protection can change. A launcher commonly creates a child and then executes its program. Thread creation shares more state instead of creating another independent process. The exact creation flags and library contracts belong in runtime references.
A pidfd holds a particular process rather than whichever process later owns a number. Programs should use that handle for stable targeting. From a shell, recheck a PID's current command, owner, and workload before acting on an old number.
Workload relationships #
| Relationship | What it identifies |
|---|---|
| Parent and child | Creation and responsibility for collecting exit results. |
| Service | A supervised definition whose processes can be restarted. |
| Submitted job | Work submitted to Peinit for management. |
| Process group | Processes targeted together by terminal job control. |
| Job-control session | Process groups and their possible controlling terminal. |
| Logon session | The authentication record referenced by identity tokens. |
A terminal pipeline and a submitted Peinit job are different uses of "job." A job-control session need not have a terminal and is not a security identity. With ordinary terminal settings, Ctrl-C and Ctrl-Z signal its foreground process group; an explicit signal to one PID has a narrower target.
Userspace ancestry normally leads to Peinit, PID 1. Orphaned descendants can be adopted by a nearer subreaper before PID 1 takes responsibility. Kernel threads and idle tasks are separate system work; a process listing is not only a list of applications started by people.
Identity and program protection #
The effective token describes who a thread acts as. The Process Security Block describes the process: its GUID, program protection, mitigations, and process security descriptor. Impersonation changes the effective identity, not the calling program's protection.
Reading a limited process summary does not grant permission to inspect its memory or stop it. A process's descriptor and Process Integrity Protection can refuse those operations even when its row remains visible. See Inspecting Process Security. For managed work, ask the manager to perform the intended operation through its own policy rather than repeatedly terminating a supervised PID.
Interpreting Process State
Peios / Using Peios / Processes
Inspect the process and its managing workload before deciding that a state means failure. Sleeping is normal for a program waiting for work.
Read the state #
| State | Interpretation |
|---|---|
| Running or runnable | Executing or ready to be scheduled. |
| Sleeping | Waiting for an event; this alone does not indicate failure. |
| Stopped | Suspended, with work able to continue after a resume. |
| Traced | Stopped under a debugger's control. |
| Uninterruptible wait | Waiting on an operation that ordinary signals cannot interrupt. |
| Zombie | Execution has ended; an exit result remains to be collected. |
A persistent uninterruptible wait calls for inspecting the underlying I/O or kernel wait, not repeatedly sending a stronger signal. A zombie cannot be fixed by terminating it again. Inspect the parent that should collect its result; accumulated unreaped children can consume process-table resources.
Choose and verify an action #
- Identify the current process, its owner, parent, and service or job. Save work before requesting termination.
- Choose the intended scope. Use
svctl stop NAMEfor a service orsvctl job stop IDfor a submitted job. Ending only a service's main process can trigger its restart policy. - For one process, use Task Manager's End process, or
kill PIDto request orderly termination. Give the application time to finish. - Refresh process and workload state. Successful signal delivery does not establish that termination has completed.
- If orderly termination fails and loss of unfinished work is acceptable, use the tool's force-termination operation. Recheck a numeric PID before using it again. Force termination skips application cleanup and cannot resolve an underlying uninterruptible wait.
kill -STOP PID and kill -CONT PID suspend and resume one process when
permitted. They do not finish its work or target an entire service. Pausing a
process can leave resources held and dependent work blocked.
Signal permissions depend on the operation, and process protection remains relevant. Sharing an account or terminal is not a general bypass. The kill guide and service controls describe the owning interfaces.
Exit and cleanup #
The parent collects a child's result through a wait operation. That result distinguishes ordinary exit from signal termination. Child-state notifications prompt the parent to check; they are not a replacement for collecting results. When a parent exits first, a subreaper or Peinit adopts remaining children.
Exit releases resources, but other owners can keep shared objects alive. Token handles elsewhere and unreaped processes can keep a logon session present after its visible work has ended. See Inspecting and Ending Sessions before interpreting a remaining session as a still-running application.
Inspecting Tasks and Sessions
Peios / Using Peios / Processes
Task Manager shows processes, resource use, jobs, and signed-in sessions. Use it to identify what is running before deciding whether to end one process, stop its service or job, or sign out a whole session.
Before you start #
You need Task Manager in a GXWI desktop. Access controls can hide process details or sessions and can prevent a stop operation. Missing details are not proof that the process has no owner or command.
Inspect and act #
- Open Task Manager and select Processes. Use Find or sort by CPU or Memory to locate the process.
- Select it and inspect its command, owner, parent, service or job, and session. Group by organizes the list by service or person.
- Choose the smallest intended scope. End process targets one process; Stop service and Stop job ask peinit to stop their managed workload.
- Review the confirmation. After an end request, a process still running after five seconds can offer End it now, which does not allow orderly completion.
Check the result #
Select Refresh or press F5 and inspect the process and its managed state. Ending a service's main process can trigger its restart policy. Use Stop service when the intended result is a stopped service. Task Manager retains a process handle for termination so a reused process ID does not redirect that request to a different process.
Sessions and visibility #
Signed in lists visible logon sessions and their processes. Sign out ends the selected session through authd; review carefully when it is your own session. A refusal or a process that cannot be ended can leave the session open. A service session is managed by its service.
The full kernel session list requires the corresponding access. Otherwise,
Task Manager lists the sessions it can infer from visible processes.
Protected processes can remain listed while their details and control are
unavailable, including to an administrator whose process lacks the needed
protection level. See gxwi-task-manager(1).
Performance Views
Peios / Using Peios / Processes
Task Manager's performance views describe recent activity on the machine. They help locate a resource bottleneck, but a graph is not a persistent monitoring history and does not explain a workload's cause on its own.
Performance groups processor, memory, disk, and network measurements. Select an item to see its graph for the last two minutes. Data is sampled every two seconds and discarded when the window closes.
Process CPU share is measured against the whole machine between samples, so it is available from the second sample. Each processor shows logical processors separately. Load averages describe runnable or waiting threads over their reported intervals rather than the percentage shown by the CPU graph.
Available memory estimates what programs can receive; cache is not all unavailable memory. Disk graphs show active time and transfer rates. Network graphs show transfer rates, not whether a remote service is reachable. Use Network Manager for addresses, routes, and name resolution.
The process list and Jobs add context. A job is work submitted to peinit outside a persistent service definition. Job visibility is checked separately from process visibility. A process can therefore be shown without details of the job it belongs to.
Do not infer a machine-wide absence from a filtered view. Task Manager reports access restrictions and protected processes; compare those notes with the list before drawing conclusions. Use Event Viewer when you need recorded events or retained metrics rather than this window's samples.
Files, Names, and Security
Peios / Using Peios / Files and Paths
File commands change names, contents, or metadata. Knowing which of those a command changes tells you whether data can be lost, and which security the result has. Every file on Peios has a security descriptor that decides who can use it, and copying, moving, and creating files treat that descriptor differently.
A name and an object are different #
A file is an object with contents, metadata, and a security descriptor. A name is an entry in a directory that refers to the object. One object can have several names, called hard links, and removing one name leaves the others. A symbolic link is a separate kind of file that stores a path, and that path can later lead to a different object, or to nothing.
Which security a file gets #
The command you use decides which security descriptor the result has:
| Operation | Result |
|---|---|
| Rename a file, including moving it within one filesystem | The same object, with its own security descriptor |
| Copy a file, including moving it to another filesystem | A new object, which inherits security from its destination directory |
| Create a file or directory | A new object, which inherits security from its parent directory |
| Add a hard link | Another name for the same object and descriptor |
Moving a file into another directory doesn't apply that directory's inherited rules to it. Inheritance happens once, when an object is created, and doesn't keep existing objects in step with their parent.
cp, mv, mkdir, and the other creation commands can request specific
security instead. Managing Files and
Directories shows how. To see or
change a file's security descriptor, use sd.
Results that need checking #
A recursive operation can fail after it has already changed part of a tree, and a command can report success while skipping files under an update policy. Check the result when every file matters.
Removing a name doesn't erase its data. Other hard links, snapshots, backups, and the storage device itself can keep copies.
What a listing shows #
A listing is for people to read. File names can contain spaces, tabs, and
newlines, so don't parse ls output to find file names in a script.
The mode, user, and group fields that ls and stat print are kept for
compatibility. They summarize some metadata, but they don't describe who can
use a file: the security descriptor does.
Every listing, metadata query, or path check describes one moment. The file can change, be replaced, or disappear before the next command runs, so a program that must act on a particular file checks the file it opens.
Managing Files and Directories
Peios / Using Peios / Files and Paths
Use these commands to copy, move, create, link, and remove files in a terminal. Each section shows the common case and the Peios behavior that affects it. The man page for each command lists every option.
Before you start #
Use a terminal on a machine with the command-line utilities installed. To try
the examples, work in an empty directory so that nothing you need is
overwritten. The examples name files such as report.txt; create them first,
or substitute your own.
Copy files #
Use cp to make a new file or directory tree from existing data:
-i asks before overwriting a file that already exists. To copy a directory
and everything in it, use cp -R notes notes-copy. If the destination already
exists as a directory, cp copies the source into it.
A copy is a new object, so it inherits security from its destination directory, and copying to another location can change who can read the data. To keep particular attributes, ask for them:
--preserve=timestampskeeps the access and modification times.--sd-explicitcarries the source's explicit access rules, and lets the destination directory add its inherited rules.--sdcopies the source's owner and its full access and audit lists.
Neither security option copies the security descriptor's group, so a copy is
not a complete security backup. cp(1) describes every preservation option
and the access each one needs.
Move and rename files #
Use mv to change a file's name or location:
Within one filesystem, a move is a rename: the file keeps its security
descriptor, even in a directory with different inherited rules. Across
filesystems, mv copies the file and then removes the source, and the copy
inherits security from its destination. Requesting particular attributes also
makes mv copy, even within one filesystem. See mv(1).
Create files and directories #
Create a directory, with any missing parents:
touch build.marker creates an empty file, or updates the timestamps of a
file that exists without changing its contents. mkfifo creates a named pipe
that passes a stream from one program to another, and mknod creates device
nodes, which needs the relevant authority. mktemp -d creates a directory
with a unique name and prints it, so another program can't claim the name
first.
A new object inherits security from its parent directory. mkdir, touch,
mkfifo, and mknod can request an owner, group, integrity label, or
complete security descriptor for the object they create. mkfifo and mknod
also accept a -m mode option, but it isn't how security is set on Peios.
Check the result with sd show before you share the location, because
choosing an owner doesn't on its own give that owner the access you meant. See
mkdir(1) for the security options.
Link files #
Create a symbolic link, a file that stores a path to another file:
A relative path in a symbolic link is resolved from the directory that
contains the link. Without -s, ln creates a hard link: another name for
the same object, sharing its contents and security. Hard links can't usually
cross filesystems. link and unlink add or remove exactly one hard link,
without the other choices ln and rm offer.
Remove files and directories #
Remove a file, with a confirmation prompt:
Removal has no undo. rm removes a directory and its contents only when you
ask for recursion. A prompt doesn't decide whether you can delete the file:
the file's security descriptor does. rmdir removes only empty directories,
which protects you from removing contents by mistake.
rm asks before deleting a read-only file, and needs -f to delete one in a
script. See Read-Only Files and Creation
Dates.
rm normally removes a file's name at once, even if a program still has the
file open; that program carries on with a file that no longer has a name. To
leave the name in place until the last program using the file closes it, as
Windows does, use --when-closed:
If a program has the file open, rm says the file will be removed when it is
closed. Until then the name stays, and opening the file again fails. A
directory goes when its last user closes it, if it is empty then. If a program
has opened the file without allowing it to be deleted, rm reports it as in
use either way.
shred overwrites a file's data before removing it, but snapshots, backups,
journals, and the storage device can keep copies that it doesn't reach. When
data must become unrecoverable, use a method designed for the storage, such as
encryption with a key you can destroy.
Change a file's length #
truncate -s 1K size-sample.bin sets a file's length. Shrinking a file
discards its end, and growing it again doesn't bring that data back. Work on a
copy when you're unsure.
Check the result #
List the result and its security:
Check the security descriptor of anything you copied or created somewhere other people can reach. A recursive command that failed part way through can leave some files changed.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
cp | Copy files and directory trees | cp(1) |
mv | Move or rename files | mv(1) |
mkdir | Create directories | mkdir(1) |
touch | Create a file or update its timestamps | touch(1) |
mkfifo | Create a named pipe | mkfifo(1) |
mknod | Create a device node | mknod(1) |
mktemp | Create a uniquely named file or directory | mktemp(1) |
ln | Create symbolic or hard links | ln(1) |
link, unlink | Add or remove one hard link | link(1), unlink(1) |
rm | Remove files and directory trees | rm(1) |
rmdir | Remove empty directories | rmdir(1) |
shred | Overwrite a file's data | shred(1) |
truncate | Change a file's length | truncate(1) |
Read-Only Files and Creation Dates
Peios / Using Peios / Files and Paths
Every file on Peios can carry two special attributes besides its security descriptor: a read-only flag, and a creation date that copies can carry over. Windows programs set and check both, and Peios keeps them the same way.
The examples use a sample file named report.txt. Create it first, or
substitute your own.
Make a file read-only #
Mark a file read-only:
No program can then open the file for writing, truncate it, replace it, or delete it, whoever runs the program, the file's owner included. Clear the flag to change the file again:
Run attrib with only file names to see which are read-only. The first
column shows R for a read-only file and - for a writable one; the second
shows the indexing preference described below:
Read-only guards against accidental change, not against other people. It
grants and denies no one access, and anyone allowed to write the file's
attributes can clear it. Use sd to decide who can
use a file. A program that already had the file open for writing keeps that
access, and you can still rename the file. A directory keeps the flag but
isn't protected by it.
Delete a read-only file #
rm asks before deleting a read-only file:
Answer y to delete it. rm -f deletes it without asking. In a script,
where rm can't ask, it refuses and leaves the file unless you give -f, so
a read-only file survives a cleanup that didn't mean to remove it. Deleting a
read-only file needs the right to change its attributes as well as the right
to delete it.
Keep files out of search #
A file or folder can say how far a search index may record it. Keep a file's contents out of search, while its name can still be found:
attrib then shows I in its second column. Keep a folder and everything
in it out of search entirely, names included:
A folder's preference covers everything beneath it, so files created there
later are covered too. To index one subfolder normally again, give it its
own preference with attrib --indexing=all Private/Shared. attrib -i
removes a file's own preference, so it follows its folder's again.
The preference narrows what a search indexer records. It doesn't hide the
file from listings or change who can open it. Windows sees it as the file's
"not content indexed" attribute through a share. A filesystem that keeps no
extended attributes, such as a USB drive formatted for another system,
can't keep it, and attrib says so.
See and set a creation date #
A file has two creation dates. Its birth time is when the filesystem created it, and nobody can change it. Its Created At is the date people and copy tools mean: a copy can carry its original's date, and you can set one. Until a file has a Created At, its creation date is its birth time.
stat shows both:
Birth is the birth time. Created is the creation date, marked (birth)
when it is only the birth time. Attributes shows read-only for a read-only
file. For one value, use stat -c %k report.txt, or %K for seconds since
the Epoch.
Set a file's Created At with touch, writing the date in any form touch -d
accepts:
This changes only the creation date. Add -d, -t, -r, -a, or -m to
change the access and modification times as well. Remove the date again, so
that the creation date is the birth time:
Copy and move files #
A plain cp makes a new file, with today's creation date and no read-only
flag. cp -p and cp -a keep the original's creation date and, if it is
read-only, make the copy read-only too:
To keep the creation date without the flag, use --preserve without a value,
or remove the flag from the selection with --no-preserve=readonly. Moving a
file keeps both.
cp won't copy over a read-only file. cp -f clears the destination's
read-only flag and copies over it, as xcopy /R does on Windows:
The copy is read-only afterwards only if you also preserve the flag and the
original is read-only, as with cp -pf. A filesystem that has no special attributes, such as a USB
drive formatted for another system, can't keep a creation date or the flag.
Commands on this page #
| Command | Use it to | Manual |
|---|---|---|
attrib | Show, set, or clear the read-only flag and the indexing preference | attrib(1) |
touch | Set or unset a file's Created At | touch(1) |
stat | Show a file's creation date and attributes | stat(1) |
cp, mv | Copy or move a file, with its creation date and flag | cp(1), mv(1) |
rm | Delete a read-only file | rm(1) |
Inspecting Files and Paths
Peios / Using Peios / Files and Paths
Use these commands to see what is in a directory, read a file's metadata, and work out what a path refers to. A path can be text you are building, a link's stored target, or a route to an existing file, and each needs a different command. The man page for each command lists every option.
The examples use sample file names such as report.txt. Create those files
first, or substitute your own.
List a directory #
Show a directory's entries, with their metadata:
Names that begin with a dot are hidden. -a includes them, and -A includes
them without the . and .. entries. dir and vdir use the same listing
engine with fixed layouts: columns for dir, one detailed row per entry for
vdir.
The ownership and permission fields in a long listing are kept for
compatibility, and don't describe who can use the file. Use sd show for
that. Don't parse ls output in a script: names can contain spaces and
newlines, and the listing is meant for people.
To color listings, dircolors -b prints a shell setting that maps kinds of
file to colors. Review the settings before adding them to your shell
configuration, and keep listings readable without color.
Read a file's metadata #
Print selected properties of a file:
Like ls, stat prints mode, user, and group fields for compatibility, and
they don't describe access. A symbolic link has metadata of its own, so decide
whether you want the link or the file it points to. A size can change before
you read the file, so a program that limits how much it reads checks the file
it has opened.
Without -c, stat also prints a file's creation date and its attributes.
Birth is when the filesystem created the file. Created is the date a copy
can carry over from its original, and is the birth time, marked (birth), if
none has been set. Attributes shows read-only for a file that no one can
change or delete until the flag is cleared. See Read-Only Files and Creation
Dates.
Resolve a path #
Choose the command by the question you are asking:
- What does this link store?
readlink latestprints the path stored in a symbolic link. The path can be relative, and its target might not exist. - Where is this existing file?
realpath -e reports/draft.txtfollows every link and prints the absolute path. With-e, every part of the path must exist. - Where would this new file go?
realpath reports/planned.txtallows the last part to be missing, andrealpath -mallows missing parent directories too. The result is a planned path, not proof that you can create the file there. - Where am I?
pwd -Pprints the working directory with every symbolic link resolved. Your shell also has its ownpwd.
A resolved path doesn't reserve a name or check access, and another program
can change the file before you open it. The quiet mode of realpath hides
error messages but not a failing exit status, so check the status before using
the output.
Split and check path text #
basename and dirname work on the text of a path without reading the
filesystem:
The first prints draft, the second reports. Neither checks that the file
exists. pathchk reports/draft.txt checks that a proposed path meets naming
limits, but success doesn't promise that creating the file will work.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
ls | List directory entries | ls(1) |
dir, vdir | List entries in a fixed layout | dir(1), vdir(1) |
dircolors | Configure listing colors | dircolors(1) |
stat | Read file or filesystem metadata | stat(1) |
readlink | Read a symbolic link's stored path | readlink(1) |
realpath | Resolve a path to an absolute path | realpath(1) |
pwd | Print the working directory | pwd(1) |
basename, dirname | Split a path's text | basename(1), dirname(1) |
pathchk | Check a proposed path name | pathchk(1) |
Measuring Space and Copying Raw Data
Peios / Using Peios / Files and Paths
Use df and du to find out how much space is available and what is using
it, and dd to copy an exact number of bytes. These commands measure and copy
storage rather than files, so read their results with the storage model in
mind.
The examples use sample file names such as source.bin. Create those files
first, or substitute your own.
Check available space #
Show the space on the filesystem that holds the current directory:
df reports space for the whole filesystem. Reserved space, metadata,
snapshots, and files that are still open after removal all affect its totals,
so free space isn't the size minus the files you can see.
Measure a directory tree #
Total the space used by a directory and everything in it:
du adds up the files it can reach. It can report allocated size, the storage
blocks a file occupies, or apparent size, the file's logical length; the two
differ for sparse and compressed files. A directory that du can't read makes
its total incomplete, so check for errors.
df and du answer different questions, and a difference between them is a
reason to look at what each one counts, not proof that either is wrong. For a
full procedure, see Diagnosing Storage
Pressure.
Copy an exact range of bytes #
Copy the first 4 bytes of a file into another file:
if= names the input and of= names the output. dd overwrites the output
without asking, so check of= before you run it, especially if it names a
device: a mistake there affects a whole disk, not one file. Counts are in
units of the block size bs= unless you choose byte units. dd finishing
doesn't mean the data has reached the storage device; use its synchronization
options or sync when that matters.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
df | Show filesystem capacity | df(1) |
du | Measure a directory tree | du(1) |
dd | Copy a byte stream in blocks | dd(1) |
Text Streams
Peios / Using Peios / Working with Text
The text utilities read a stream of bytes and divide it into records, usually one record for each line. Each command then does one thing to those records: shows some of them, combines them, reorders them, or changes their characters. You can join the commands in a pipeline, where each one reads the previous command's output. A few rules decide whether the result means what you expect.
Records and delimiters #
Most commands end a record at each newline. Commands that select fields, such
as cut and join, also split each record at a delimiter character you
choose. A delimiter is only a character, not a parsing rule: these commands
don't understand quoted values or escaped delimiters, so use a parser for
formats that have them.
Commands that count bytes rather than lines or characters can split a character that takes more than one byte. Use line or character counts for text that people will read.
Keep input and output separate #
The shell opens an output file before the command starts. Redirecting output to the file a command is reading empties that file before the command reads it:
Always write to a different file, check it, and only then replace the original. A command that exits with an error can leave partial output, so check its exit status, not only whether the output file exists.
Order and comparison rules #
Some commands compare records with each other. uniq compares neighboring
lines only, so sort first to bring equal lines together. join and comm
need both inputs sorted with the same rules.
Sorting depends on the locale, which sets the language rules for comparing
text. Set the same locale for every command in a pipeline that compares
records. LC_ALL=C gives an ordering by byte value that is the same on every
machine:
LC_ALL=C
Commands for each task #
Choose the page by what you want to do:
- Viewing and Combining Text to read files, select parts of them, and combine or split them.
- Transforming Text to sort, count, translate, and reformat text.
- Verifying Checksums and Encoding Bytes to check that data hasn't changed, or to carry bytes as text.
Viewing and Combining Text
Peios / Using Peios / Working with Text
Use these commands to read text files, pick out the parts you need, and combine or split them. None of them change the files they read; they write their result to standard output. The man page for each command lists every option.
The examples use sample file names such as names.txt. Create those files
first, or substitute your own.
Read a file #
cat writes files to standard output one after another, which also combines
them:
cat -A shows tabs, line endings, and other invisible characters, and
cat -n numbers the lines. For a long file, more shows one screen at a
time: press Space for the next screen, / to search, and
Q to stop. nl prints a numbered copy that leaves blank lines
unnumbered, and tac prints lines from last to first.
Read the start or end #
Show the first two lines of a file:
tail -n 2 progress.log shows the last two lines. Without -n, head shows
10 lines. To watch a log as it grows, use tail -f, which follows the file it
opened. If a program replaces the log with a new file of the same name,
tail -F follows the name instead and keeps going. Press
Ctrl+C to stop. With several files, head and tail
label each one, and the labels become part of the output.
Inspect raw bytes #
When a terminal would hide or reinterpret characters, od shows each byte as
a number:
-tx1 shows one byte per hexadecimal value, and -An hides the offset
column. Repeated rows are collapsed to * unless you add -v.
Select fields #
cut selects fields from each line, split at a delimiter:
A line without the delimiter passes through unchanged unless you add -s.
Combine files #
Choose by what links the lines together:
- By position.
paste names.txt counts.txtputs the first line of each file side by side, then the second, and so on. A missing line shifts every later pair. - By a shared key.
join counts.txt colors.txtcombines lines whose first field matches. Both files must be sorted on that field with the same rules, and a repeated key produces more than one output line. - By membership.
commcompares two sorted files and shows the lines found only in the first, only in the second, or in both.
For join and comm, set the locale to the one you sorted with, for example
LC_ALL=C join counts.txt colors.txt.
Split a file #
Split a file into pieces of two lines each:
The pieces are named piece-aa, piece-ab, and so on, and joining them in
that order with cat restores the original. csplit report.txt '/Section/'
splits at a line that matches a pattern instead. Both commands can overwrite
existing files with the same names, so run them in an empty directory. New
pieces inherit security from their directory.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
cat | Write files to output in order | cat(1) |
more | Read a file one screen at a time | more(1) |
nl | Number lines | nl(1) |
tac | Print lines in reverse order | tac(1) |
head, tail | Read the start or end of a file | head(1), tail(1) |
od | Show bytes as numbers | od(1) |
cut | Select fields from each line | cut(1) |
paste | Combine lines by position | paste(1) |
join | Combine lines by a shared key | join(1) |
comm | Compare two sorted files | comm(1) |
split, csplit | Split a file into pieces | split(1), csplit(1) |
Transforming Text
Peios / Using Peios / Working with Text
Use these commands to change the order, characters, or layout of text. Each writes a transformed copy to standard output and leaves its input unchanged. Decide which properties of the text carry meaning before you transform it: a reflow can break code, and a sort loses the original order. The man page for each command lists every option.
The examples use sample file names such as names.txt. Create those files
first, or substitute your own.
Sort and count records #
Sort lines as numbers rather than as text:
LC_ALL=C
Without -n, sort compares text, so 12 sorts before 3. Use a key field
when each line holds both a name and a value. To write the result over the
input, use the command's output option rather than shell redirection, which
would empty the input first. See sort(1).
uniq compares neighboring lines only, so sort first to count every repeated
value:
LC_ALL=C |
wc -l -w -c names.txt counts lines, words, and bytes. The line count counts
newline characters, so a last line with no newline isn't counted. Byte and
character counts differ for characters that take more than one byte.
Translate characters #
tr changes or removes characters in standard input:
| LC_ALL=C
tr reads only standard input; it takes no file name. A range such as a-z
doesn't convert letters in every writing system, so keep to ASCII text or use
a tool that understands the language. Quote the character sets so that the
shell doesn't interpret them.
Convert tabs and spaces #
expand -t 4 tabs.txt replaces each tab with the spaces needed to reach the
next tab stop, and unexpand -t 4 spaces.txt turns suitable runs of spaces
back into tabs. Without -t, expand puts tab stops eight columns apart.
Keep the original when tabs carry meaning in the file's format.
Reflow and paginate #
fmt -w 30 notes.txt rejoins the words of each paragraph into lines of at
most 30 characters. Use it for prose only: it changes the line breaks that
code, tables, and markup depend on. fold -s -w 12 breaks long lines without
joining short ones. pr adds page headings and margins for printing, so don't
pass its output to a program that expects the original lines.
Order dependencies #
tsort reads pairs in which the first item must come before the second, and
prints an order that satisfies every pair:
|
If the pairs form a cycle, no order exists and tsort fails; check its exit
status rather than using partial output. Items with no dependency between them
can come out in any order.
Shuffle and index #
shuf names.txt prints the lines in a random order, and can take a sample.
Given a recorded random source, it repeats the same shuffle, which helps in
testing but isn't suitable for choices that must be unpredictable. ptx
builds a keyword index that shows each word with the text around it.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
sort | Sort lines | sort(1) |
uniq | Collapse or count repeated neighboring lines | uniq(1) |
wc | Count lines, words, and bytes | wc(1) |
tr | Translate or delete characters | tr(1) |
expand, unexpand | Convert between tabs and spaces | expand(1), unexpand(1) |
fmt | Reflow paragraphs | fmt(1) |
fold | Wrap long lines | fold(1) |
pr | Paginate text for printing | pr(1) |
tsort | Order items by their dependencies | tsort(1) |
shuf | Shuffle or sample lines | shuf(1) |
ptx | Build a keyword-in-context index | ptx(1) |
Verifying Checksums and Encoding Bytes
Peios / Using Peios / Working with Text
A checksum, or digest, summarizes a file's bytes so that you can later check whether they changed. An encoding represents bytes as printable text so that they can pass through an interface that carries only text. Neither proves who produced the data: that needs a trusted source for the expected value, or a signature.
The examples use sample file names such as release.txt. Create those files
first, or substitute your own.
Record and verify digests #
Record a SHA-256 digest of a file, then check the file against it:
The check reports each file and whether its bytes still match, and fails if any doesn't. Anyone who can replace both the file and its checksum list can make the check pass, so get the expected digest through a channel you trust, or verify a signature with a trusted key.
cksum offers several algorithms through one command. Name the algorithm so
that a saved result says what it means:
The default cksum algorithm and the older sum checksum detect accidental
changes, such as transmission errors. They have too few possible values to
identify a file securely, so use a cryptographic digest such as SHA-256 for
new work.
Encode and decode bytes #
Encode a file as Base64 text, then decode it:
base32 works the same way with a different alphabet. basenc selects among
several encodings, such as --base64url, the variant used in web addresses.
Use the encoding the receiving program expects: Base64 and its URL-safe form
look alike but aren't interchangeable.
Encoding isn't encryption: anyone with the text can decode it. A decoder can write part of its output before it finds invalid input, so check its exit status, and don't let another program use the output until the whole decode has succeeded.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
sha256sum and the other digest commands | Record and check file digests | sha256sum(1) |
cksum | Calculate a checksum with a chosen algorithm | cksum(1) |
sum | Calculate an older checksum another system requires | sum(1) |
base64, base32 | Encode bytes as text | base64(1), base32(1) |
basenc | Encode with a chosen alphabet | basenc(1) |
Printing Output and Reading Command Status
Peios / Using Peios / Scripts and the System
A command reports results in two ways: the data it writes to its output, and an exit status, a number where zero means success. Scripts use output for data and status for decisions. These commands are the building blocks for both. The man page for each command lists every option.
Your shell has its own versions of some of these commands, such as echo,
printf, test, and kill. To run the utility itself, put peiosutils
before its name, as some examples here do.
The examples use sample file names such as report.txt. Create those files
first, or substitute your own.
Print messages and values #
echo prints its arguments, which suits a short fixed message:
For any value that comes from elsewhere, use printf with a fixed format, so
that the value can't be read as an option or as formatting:
Keep the format under your control and pass data as the later arguments. The format repeats if more arguments remain.
seq 2 2 8 prints numbers from 2 to 8 in steps of 2, and yes sample prints
a line repeatedly until it is stopped. Don't pipe yes into a program to
answer prompts you haven't read: use the program's own option for running
without prompts. numfmt --to=iec-i shortens a byte count with a binary
prefix, which scales by powers of 1024. The result is rounded, so keep the
exact number for any calculation.
Run a command with a changed environment #
env runs one command with an extra or changed environment variable, without
changing your shell:
printenv prints one variable when you name it, and fails if the variable
doesn't exist, which tells an empty value apart from a missing one. Without a
command, env prints the whole environment, which can contain credentials, so
don't share that output. A cleared environment helps make a command
repeatable, but it isn't a security boundary.
Test conditions #
test reports a condition through its exit status and prints nothing:
if ; then
fi
Quote variables so that an empty value stays one argument. A file test
describes one moment: the file can change before you use it. true and
false exist only for their status. Don't add || true to hide a failure
unless you've handled the failure you expect.
expr 7 + 5 evaluates a small integer expression; quote operators such as *
that the shell would interpret. factor 84 prints the prime factors of a
number.
Read exit statuses #
A false condition isn't always an error. expr, for example, uses one status
for a zero or empty result, another for a true result, and a third for an
invalid expression. In a pipeline, each command has its own status, and the
shell decides which one the pipeline reports. Read a command's man page before
treating every nonzero status the same way.
Save a stream while showing it #
tee writes its input both to standard output and to a file:
|
tee replaces the file's contents unless you use append mode. A new file
inherits security from its directory, and an existing file keeps its own, so
choose the directory with care when the stream holds private data.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
echo | Print a short message | echo(1) |
printf | Print values with a fixed format | printf(1) |
seq | Print a sequence of numbers | seq(1) |
yes | Print a line repeatedly | yes(1) |
numfmt | Format numbers for people to read | numfmt(1) |
env | Run a command with a changed environment | env(1) |
printenv | Print an environment variable | printenv(1) |
test | Check a condition | test(1) |
true, false | Succeed or fail | true(1), false(1) |
expr | Evaluate a small expression | expr(1) |
factor | Print prime factors | factor(1) |
tee | Copy a stream to a file and to output | tee(1) |
Reading System Information
Peios / Using Peios / Scripts and the System
Use these commands to read facts about the running system: the time, what is running, how much processing capacity is available, and the terminal you are using. Each value describes one moment, so don't rely on it staying the same. The man page for each command lists every option.
Read the time #
Print the current time in Coordinated Universal Time (UTC), in a form that other programs can read unambiguously:
Printing a time doesn't change the clock. Setting the clock requires the relevant authority, and can affect scheduled jobs. To manage the clock and time zone, see Keeping the Time.
Identify the system #
uname -s prints the kernel's name and uname -o the operating system's.
arch prints the machine architecture. These values don't tell you which
version of each installed component you have, or whether a particular program
will run: use the package information and each program's own checks for that.
hostname prints the machine's host name. Another machine can't necessarily
find this one by that name; that depends on the network and its name service.
Make a lasting change through the network
configuration, because a
configuration service can restore its own value over a name you set directly.
hostid prints a short identifier kept for compatibility. It can repeat
across machines, so never use it to identify a machine securely.
Check capacity and load #
nproc prints the number of processors available to the current program,
which can be fewer than the machine has. Memory and storage can limit parallel
work too, so use it as a starting point when choosing how many jobs to run.
uptime shows how long the system has been running and its load: a measure of
work that is running or waiting, not a percentage of processor use. For
signed-in sessions, use Inspecting and Ending
Sessions instead.
Check the terminal #
tty prints the terminal connected to standard input, and fails if input
comes from a pipe or a file. A script can use that status to tell whether a
person is typing. stty -a shows the terminal's settings, such as whether
typed characters are echoed. If a script changes those settings, save them
first and restore them even when the script fails.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
date | Print or set the time | date(1) |
uname | Print system identifiers | uname(1) |
arch | Print the machine architecture | arch(1) |
hostname | Print the host name | hostname(1) |
hostid | Print the host identifier | hostid(1) |
nproc | Print the processors available | nproc(1) |
uptime | Print how long the system has run, and its load | uptime(1) |
tty | Print the terminal connected to input | tty(1) |
stty | Read or change terminal settings | stty(1) |
Running and Controlling Commands
Peios / Using Peios / Scripts and the System
Use these commands to control how and how long another command runs. They suit short jobs in a terminal or a script. A job that must keep running, restart when it fails, or start when the machine starts belongs to the service manager instead; see Services and Jobs. The man page for each command lists every option.
Wait and set time limits #
sleep 0.1 pauses for a tenth of a second. A pause doesn't prove that
anything finished, so wait for an explicit sign that a service is ready rather
than sleeping and hoping.
timeout stops waiting for a command after a time limit:
When the limit expires, timeout sends a signal, and the command must still
respond to it. An option can force a stop after a grace period, but a command
stopped part way through can leave partial output behind. See timeout(1) for
its exit statuses.
Keep a command running after you disconnect #
nohup starts a command that keeps running when its terminal disconnects.
Output that would have gone to the terminal goes to nohup.out in the working
directory instead. A new nohup.out gets security that admits only you; an
existing one is added to and keeps its own security. nohup doesn't put the
command in the background (end the line with & for that), and it doesn't
protect the command from failing, other signals, or shutdown.
Adjust priority and buffering #
nice -n 5 runs a command with a lower scheduling preference, so it yields to
other work. Raising a command's preference needs extra authority. Niceness
doesn't change the command's identity or what it can access.
When a pipeline's output arrives late because a program holds it in a buffer,
stdbuf -oL asks the program to write each line as soon as it is complete. It
works only for programs that use the standard C output functions; a program's
own option for flushing output is more reliable.
Send signals #
peiosutils kill -l lists the signals. kill sends a signal to a process: a
request to change state, which a program can handle. The usual stop signal
lets a program clean up; a forced kill doesn't. Process numbers are reused
after a process ends, so check the target first. Whether you can signal a
process is an access decision, and knowing its number grants nothing.
Run a command in another root directory #
chroot runs a command with a different directory as its root, so that
absolute paths are found inside that directory. The directory must contain
everything the command needs, including its libraries. A changed root only
changes where paths are looked up: it doesn't change the command's access
token, privileges, network access, or open files, so it isn't a way to contain
untrusted code. It also requires the relevant authority.
Flush pending writes #
sync asks the system to write pending changes to storage. How durable the
data then is still depends on the filesystem and the device. sync doesn't
make a half-written file complete or check that its contents are right.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
sleep | Pause for a time | sleep(1) |
timeout | Run a command with a time limit | timeout(1) |
nohup | Keep a command running after a disconnect | nohup(1) |
nice | Run a command with a different priority | nice(1) |
stdbuf | Change a command's output buffering | stdbuf(1) |
kill | Send a signal to a process | kill(1) |
chroot | Run a command in another root directory | chroot(1) |
sync | Write pending changes to storage | sync(1) |
Checking Who a Command Runs As
Peios / Using Peios / Scripts and the System
whoami, id, groups, and logname give quick answers about the identity
a command runs with. They show the account name and group memberships, but not
everything that decides what the command can do. For that, read the command's
access token with token.
Read the account name #
whoami prints the name of the account the command runs as. If the identity
service can't find a name for the account, whoami fails, but the command
still has an identity: a failed lookup is only a failed lookup.
logname prints the account that signed in to the session. It can differ from
whoami when a program has taken on another identity.
Read identity numbers and groups #
id shows the account and its groups as numbers, with their names, and adds
the user's security identifier (SID) and integrity level. The numbers are kept
for compatibility. Peios decides access with SIDs and the other contents of
the token, and the numbers can't show all of them: some groups have no number,
and a deny-only group looks the same as an ordinary one. Two commands can
print the same numbers and still be allowed different things.
groups prints the group memberships that have numbers.
Ask about the command or about an account #
Without an account name, id and groups describe the command you run them
from, using its token. With an account name, they ask the identity service
about the account record instead. A token includes groups added at sign-in,
such as Everyone, that aren't stored in the account record, so the two answers
can differ without either being wrong.
See the full token #
When an access decision depends on more than names and numbers, read the token:
It shows every group with its attributes, the privileges, and the integrity level. See Inspecting Effective Identity.
Commands on this page #
This page covers these commands:
| Command | Use it to | Manual |
|---|---|---|
whoami | Print the account a command runs as | whoami(1) |
logname | Print the account that signed in to the session | logname(1) |
id | Print identity numbers, names, SID, and integrity level | id(1) |
groups | Print group memberships | groups(1) |
token | Show the full access token | token(1) |
Local Accounts
Peios / Using Peios / Local Accounts
Local accounts identify people and services known to this machine. The local
principal source is lpsd. It stores those accounts and checks their
credentials. Use lps(1) to administer the store through the daemon.
An account is one kind of principal: an identity that can receive access. Groups collect principals so that access rules can name a group instead of every member. Each local account and group has a security identifier (SID), which remains the same when its name changes.
Identity, credentials, and access #
Three separate decisions determine a sign-in:
- The account: its name, SID, group memberships, and profile.
- Its credentials: the password or public keys it holds and the policy selecting which credentials it accepts.
- Machine policy: the privileges and integrity level that
authdplaces on the resulting access token.
An access token records the identity and authority of a running process.
lpsd supplies identity information; authd grants the token. A source
cannot grant a privilege by adding it to an account's profile.
Changing a password and requiring that password are separate actions. For
example, setting a password on an account with the none credential policy
does not stop credential-free sign-in. Read Managing
Credentials before changing the
permitted methods.
Choose the right tool #
Use the tool for the task you need:
- Inspect or administer local accounts: use
lpsas an administrator. - Sign in at a terminal: use the managed console's
login(1)client. - Integrate an application: use the authentication client library.
- Diagnose the daemons: start with Diagnosing Authentication.
lps does not edit the store file directly. lpsd checks the caller's token,
applies the request, and saves the result. An ordinary signed-in account does
not acquire administrative rights by running the command.
Changes and existing sessions #
An account change affects later requests and tokens. Removing a group, changing a password, or stopping an account from signing in does not rewrite access tokens already issued to it.
For retiring an account, distinguish stopping further sign-ins from ending existing work. Follow Retiring an Account, and keep a working administrator session while changing access.
For desktop administration, use Principals Manager. Personal display names, passwords, and keys are covered by My Settings. Those interfaces preserve the same distinction between identity, credentials, and machine grants.
Profiles and Claims
Peios / Using Peios / Local Accounts
A profile tells a client how to start a session. Claims describe account attributes that access rules can evaluate. Both are stored with the account, but they serve different purposes.
Profile preferences #
The profile includes a home path, shell path, and display name. An
administrator changes it with lps set. For example:
The display name is presentation text. It is not a credential, an account lookup key, or evidence of a different identity. A person can change their own display name through the self-service account interface.
Changing a home path does not move files. Changing a shell affects later
sessions rather than replacing a running shell. Use absolute paths for homes
and shells; login rejects a relative profile path and uses its fallback.
Renaming an account with lps rename is a separate action. The account's
security identifier (SID), group memberships, and recorded home remain
unchanged.
Claims used in access decisions #
A claim has a name, a value type, and one or more values. An administrator can set a claim such as a department:
The claim has an effect only where an access rule evaluates it. A string named
Administrator does not grant administrator membership or a privilege by
itself.
Claim names use per-character Unicode lowercase matching without normalization
or full case folding. Équipe and équipe name one claim; ß and ss do not.
Setting department replaces an
existing Department claim. A claim with no values remains present and is
different from removing the claim; access rules can distinguish the states.
Claims are copied into a token when it is issued. Changing a stored claim does not change tokens that already exist. Test the intended access rule with a fresh session after a claim change.
Octet claim values use pairs of ASCII hexadecimal digits. Invalid text, including non-ASCII characters, produces a usage error without changing the account.
The complete claim types and command syntax belong to lps(1). The machine's
privilege grants are described separately in Granting
Access.
Sessions and Account Changes
Peios / Using Peios / Local Accounts
A logon session groups work started with a granted identity. Its access tokens contain the account information and machine policy evaluated when the tokens were issued. Changing the stored account does not rewrite them.
Stop new access and active work separately #
Turning an account off, changing its password, removing a key, or removing a group membership changes later authentication and token creation. A program already running with a token can retain its previous access.
For an account retirement or suspected credential compromise, decide both whether further sign-ins are permitted and whether existing sessions must end. Neither action substitutes for the other.
Ending a session #
An authorized client asks authd to end a session. The authority finds
processes whose primary tokens belong to it, asks them to exit, and kills
survivors after a grace period. Repeated scans are bounded, so the result can
report processes that remain.
The kernel removes the session when its last token reference is released. An external process holding a token reference can keep the session alive after its ordinary processes have exited. Ending a session is not a promise that every reference to its tokens has disappeared.
Who can request it #
A signed-in person can end their own eligible session. Ending another person's
session requires access granted by SessionEndSecurity under
Machine\Generic\Authn\Policy. SYSTEM, anonymous, and service sessions are
protected from this operation.
The library offers a permission query so an application can decide whether to present an action. The actual request is checked again; a query is not a reservation of authority.
If the requesting application belongs to the target session, authd replies before ending its processes. Counts in that reply are prospective rather than confirmed terminations. The application can disappear before it renders the result.
Read authd(8) for termination behavior and the registry manual for
Machine\Generic\Authn\Policy:SessionEndSecurity. Application authors should
also read Self-Service
Operations.
Creating an Account
Peios / Using Peios / Local Accounts
Create an account with lps when someone needs an identity held by this
machine. Account creation saves the identity and profile; the home directory
is prepared separately at sign-in.
Before you start #
Check these prerequisites:
- Use a session with active
Administratorsmembership or authorizedLocalSystemaccess. - Confirm that
lpsdis ready. - Keep an existing administrator account available. These instructions do not provision a machine's first account.
Create and inspect the account #
Follow these steps:
-
Run the interactive account creator:
Replace
alicewith the account name. Supply the requested profile and password, review the proposed account, and confirm it. Leave additional groups empty unless the account needs them. -
Inspect the saved account:
Check its state, credential policy, groups, home, and shell. An ordinary account defaults to
/home/aliceand/bin/sh. No matching per-user group is created automatically. -
Keep your administrator session open and sign in as
alicethrough a separate permitted console or client. Check that the intended shell starts and the home directory is accessible.
The final check tests the complete sign-in route. A saved account alone does not prove that a client can reach the authority or collect its required credentials.
Administrator accounts #
If the account must administer the machine, request the membership during creation:
This grants access to local account administration. The separate machine policy determines the privileges on tokens issued to that group.
Home directories #
lps records the home path without creating the directory. When authd
grants a logon with a home path, it creates a missing home with access for the
account, LocalSystem, and administrators. The descriptor blocks inherited
grants from widening that access. The directory is created with that
descriptor, so it never exists without it. The parent directory must already
exist; authd creates the missing leaf, not a parent tree.
The shipped authd service retains SeRestorePrivilege to assign the new
home's owner and group. If it is removed from the service's
RequiredPrivileges, the kernel refuses the descriptor and no home is
created. The authority's diagnostics record the failure, and the logon starts
in /. Retrying a sign-in does not take over a directory that already exists.
An existing directory is left alone. Changing the recorded home does not move
files or repair its ownership. If home preparation fails, the logon can still
succeed; login reports an inaccessible home and starts in /.
Every kind of logon prepares the home by default, including network logons
such as file sharing, so a file server can offer users their homes. To limit
it, list the logon types that should prepare homes in
Machine\Software\Authd ProvisionLogonTypes. For the Windows behavior,
where a network logon creates no profile, leave out Network and
NetworkCleartext. The same setting governs the account's per-user Registry
root.
The first account #
On a machine with no store, lpsd creates an empty store and a machine
domain. It does not invent an administrator or a password. An image must
provide an authorized first-account setup route.
An installed image can use first-boot
setup. A custom image must enable that
service or provide another authorized provisioning route. A service that
uses lps to provision an account starts after lpsd is ready; an early boot
script running before the services cannot use its socket.
The optional dev.peios.authd-live-account package supplies a development
bootstrap. Its credential-free administrator is a deliberate image policy
choice, not a default for installed systems. Do not use that package to solve
ordinary account creation on a production machine.
For exact creation options, read lps(1).
Managing Credentials
Peios / Using Peios / Local Accounts
Manage an account's credential material and its permitted methods as two
separate steps. Adding a password or public key does not change which methods
lpsd accepts for that account.
Before you start #
Prepare an alternate access route:
- Use an administrator session for these
lpscommands. - Keep a working administrator route open while changing another route. Verify a fresh sign-in before closing it.
Inspect the account first:
Replace alice with the account name. Credential policy selects the accepted
proof:
| Policy | Accepted proof | Required material |
|---|---|---|
password | Password | Stored password verifier |
key | SSH public-key proof | Enrolled public key |
either | Password or SSH public-key proof | Material for the chosen method |
none | No credential | None |
denied | No accepted method | None |
Missing material does not cause a fallback to another method. The client and
authority also constrain which method and kind of logon are allowed. The
terminal login client cannot perform an SSH public-key exchange.
Require a password #
Follow these steps:
-
Set the password through the prompt, keeping it out of command history:
-
Select password authentication:
-
Inspect
lps show alice, then verify a fresh sign-in with that password.
Both steps are needed when replacing none policy. Setting the password alone
leaves credential-free sign-in permitted.
Add a public key #
Follow these steps:
-
Enroll the public key file:
Replace the path with a public key file.
workstationis a descriptive label. Do not supply a private key. Supported keys and input restrictions are documented inlps(1). -
Inspect
lps key list aliceand compare the fingerprint with the key you intended to enroll. -
If password access must remain available while checking the key, select both methods:
-
Verify a fresh connection through an SSH service configured to use this authority. Only after that check, use
lps policy alice keyif the account must accept keys exclusively.
Enrolling a key does not configure an SSH server or make one reachable.
Remove a key #
Follow these steps:
- Run
lps key list aliceand identify the key to remove. - Pass its listed key ID to
lps key remove alice <key-id>. - Inspect the list again and verify the remaining sign-in route.
The administrative command takes the key ID, not its fingerprint. The public library's self-service removal operation takes a fingerprint; do not interchange the two interfaces.
Removing a key or changing policy invalidates pending SSH key proofs but does not end existing sessions. Stopping active access is a separate session operation.
Self-service changes #
A person changing their own password or keys uses an authentication
conversation through authd, rather than the administrative socket. lpsd
requires an accepted current password for these operations. An account with
only a key, no credential, or no stored password needs an administrator's
help.
Application authors can use the self-service client operations.
Managing Groups
Peios / Using Peios / Local Accounts
Use a local group when several accounts need the same access. The group has its own security identifier (SID), so its name can change without changing the identity named by access rules.
Before you start #
Check these prerequisites:
- Use an administrator session with access to
lpsd. - Create the account
alicebefore following this example.
Create a group and add a member #
Follow these steps:
-
Create the group with a description:
-
Add the account:
-
Check
lps group listandlps show alice. Verify the group and the account's membership before using the group in an access rule. -
Start a fresh session for
aliceto receive a token with the changed membership. Existing tokens retain their previous groups.
Creating the group does not grant access to any file or service. Assign that access separately using the resource's security policy.
Name a group unambiguously #
lpsd resolves a group name, a qualified built-in name, or a literal SID.
Well-known names such as Administrators take precedence over local names,
and local groups cannot take those reserved names.
For automation or policy that must survive renaming, use the SID reported for the group. In authd's registry policy, use a local group's literal SID; local group names are not resolved there.
Change or remove a group #
Rename a group with lps group rename developers engineers. Its SID and
members remain. A description can be changed separately with lps group describe.
To retire a group, first remove its memberships and replace any account's
primary-group assignment. lps group delete refuses a group that still has
members or is used as a primary group.
Before deletion, also review resources whose access rules name the SID. Deleting the group does not rewrite those rules. Recreating its name allocates a different SID and does not restore its access.
Read lps(1) for the full command syntax.
Retiring an Account
Peios / Using Peios / Local Accounts
Retire an account by stopping further sign-ins before deciding whether to delete its identity. Keeping the account preserves the security identifier (SID) used by its files and other access rules.
Before you start #
Prepare access and active work:
- Use an administrator session other than the account being retired.
- Keep another verified administrator route available.
- Save work in sessions that must end. Ending a session can stop applications before they save their work.
Stop further sign-ins #
Follow these steps:
-
Inspect the account with
lps show aliceand record its SID and groups. -
Stop it from signing in:
-
Inspect
lps show aliceagain to confirm the saved state. -
If active access must stop, use a session-management client to end its existing sessions. Account state changes do not revoke issued tokens.
To restore the account later, use lps enable alice, inspect its policy, and
verify a fresh sign-in.
The last-administrator guard #
lpsd refuses several changes to the last account it counts as an active
administrator. These include deletion, stopping sign-in, removing its
administrator membership, and leaving it no permitted credential material.
The guard counts accounts that are turned on and hold administrator membership. It does not prove that another administrator has usable credentials, permitted logon types, or a reachable sign-in route. It also does not validate the whole machine's registry policy. Verify an alternate route yourself.
Delete only after reviewing ownership #
If the identity must be removed permanently, review files and access rules
that name its SID before running lps remove alice.
The account's identifier is never reused. Creating another alice does not
restore the deleted identity, its group membership, or its access. Deleting
the account also does not remove its home directory.
Read Sessions and Account Changes for the limits of ending active access.
Principals Manager
Peios / Using Peios / Local Accounts
Principals Manager displays identities the machine knows and administers local users and groups through lpsd. Built-in identities such as SYSTEM and Administrators are defined by the system; they are not ordinary local accounts to recreate or delete.
Users and Groups show names, identifiers, membership, and available details. A user's page includes permitted sign-in methods, claims, and administrative credential information where access allows it.
Local-account changes go through lpsd. The backend enforces its rules, including retaining an enabled administrator that can sign in. The window reports a refusal rather than bypassing that safeguard.
Privileges edits local sign-in policy in the registry. Those records can set privileges, integrity, owner, and a default discretionary access control list. A user's page previews the combined policy for a new sign-in. Changing that policy is separate from editing the local account, and uses the policy key's write access.
Account administration requires the enabled Administrators group in the requester's token. Policy writes require the registry rights instead. The interface shows read-only data when it can inspect an object but cannot change it. Changes to sign-in policy apply to new sign-ins, not retroactively to existing tokens.
See Managing Local Accounts and
gxwi-principals-manager(1). The account authority and shared sign-in
semantics remain documented with authd and lpsd.
Reviewing local policy #
Privileges lists local policy records and a Denied to everyone entry. A denied privilege cannot be granted by another record. A user's policy preview combines the records for that user, their groups, and Everyone; select the intended kind of sign-in before interpreting it.
New record selects a principal. Edit changes its privileges, integrity, owner, or default DACL. An empty field makes no assignment for that field. Delete removes the record; it does not imply a deny if another applicable record still grants access. Default DACL text must be valid SDDL understood by authd.
The editor warns before removing SeChangeNotifyPrivilege from Everyone
or Administrators because losing directory-traversal privilege can prevent
shell startup. On a machine with no policy, authd's default gives Everyone
that privilege. The editor preserves this default when it creates the
first policy, rather than silently discarding it.
Policy warnings above the list identify records authd ignores or duplicate principal assignments. Resolve these using the shared account-policy reference. Refresh with F5 after another administrator changes an account or policy record.
Managing Accounts in Principals Manager
Peios / Using Peios / Local Accounts
Use Principals Manager for a local user's membership, credentials, claims, and permitted sign-in methods. Check the identity and the effect on future sign-ins before making a change.
Before you start #
You need the account-administration access enforced by lpsd. Preserve a working administrative sign-in route when changing administrative membership or credentials.
Inspect and change an account #
- Open Principals Manager, choose Users or Groups, and use Find to locate the identity.
- Select it and check its security identifier, local or built-in status, memberships, and sign-in configuration.
- Choose the intended account operation and review its confirmation. Change only the membership, claim, credential, or sign-in setting required for the task.
- Read lpsd's response. If it refuses a change that would leave no enabled administrator able to sign in, retain or repair another valid route before reconsidering the operation.
Check the result #
Refresh with F5 and verify the stored identity and membership. Test a new sign-in when the change concerns credentials or token policy. Existing sessions retain their own tokens.
Use Privileges for registry-based local sign-in policy. Its preview describes what a new sign-in would receive, not the rights of every already running process. For changing only your own display name, password, keys, or locale, use My Settings instead.
Choosing an account action #
Account actions have different effects:
| Action | Effect |
|---|---|
| Edit | Changes the full name, home path, shell, or primary group. Changing the home path does not move files. |
| Rename | Changes the name while retaining the SID and existing access grants. |
| Set password | Changes the password without ending existing sessions. |
| Sign-in | Selects accepted credentials and permitted kinds of sign-in. |
| Disable | Refuses new sign-ins while preserving the account and its SID. |
| Delete | Removes the account permanently; its old SID is not reassigned. |
Adding an SSH key does not itself enable SSH-key authentication. Check Sign-in as well. Credential-free sign-in does not permit SSH access. Explicit permission to run a service is separate from ordinary sign-in methods. An empty claim and an absent claim have different meanings to access conditions; inspect the intended condition before removing one.
A group rename retains its SID. A user's primary-group membership cannot be removed until another primary group is assigned. Built-in groups with stored membership can have members added or removed, but their system identity cannot be renamed or deleted.
Disabling an account does not end its existing sessions. Use Task Manager to request sign-out when required, after accounting for unsaved work. The account store's last-administrator safeguard does not prove that a console or network sign-in route is reachable. Test fresh access before closing your working administrative session.
Creating an account #
To create a local user:
- Select Users, then New user, or press Ctrl+N.
- Enter the sign-in name and optional full name. Set and confirm a password, or explicitly select credential-free sign-in where permitted.
- Select administrator membership only when required. Check the proposed home path and shell before selecting Create.
- Read the result and verify the new user's SID and configuration. A refused creation does not leave a partially configured user.
To create a group, select Groups, then New group, and provide its name and description. Add members after verifying the new group's SID.
Changing Your Account Settings
Peios / Using Peios / Local Accounts
My Settings operates on your own account. Its backend identifies you from your token rather than accepting another account name. Use Principals Manager for administrative changes to other accounts.
Before you start #
You need a GXWI session and permission for the selected personal setting. Changing a password or SSH key requires your current password. A key-only account without a password cannot use those self-service forms.
Change a personal setting #
- Open My Settings and choose Account, Password, SSH Keys, or Language & Formats.
- For a display name, enter the new name and select Apply. For a password, enter the current password and the new password twice.
- For an SSH key, use Add Key with one public-key line and your password, or select Remove for the intended key and authenticate.
- Read the backend's outcome. Credential fields are cleared after the request, including on failure.
Check the result #
Inspect the resulting name or key list. Changed credentials and locale choices affect subsequent sign-ins; they do not replace the token of an already running session. Keep the current session available while verifying a new credential through the intended sign-in route.
System Default and Match Language remove the relevant personal
locale override. Locale choices are written under CurrentUser\Locale
and apply at the next sign-in. A restricted registry key makes the
section read-only. Account state refreshes every five seconds.
See gxwi-my-settings(1) for interfaces and file locations.
Language and formats together #
The form writes LANG and the time, number, money, measurement, and paper
format categories together. Changing Language can therefore replace or
remove individually configured format overrides. Use reg for a deliberate
single-value edit instead.
Match Language removes personal category values; it does not remove machine category values. For one locale across these formats despite machine overrides, select it in both lists. Verify a fresh session as described in Choosing Session Locales.
Changing Your Password
Peios / Using Peios / Local Accounts
Use passwd to change the password of the account represented by your
current process token. The account authority decides which credentials to
request and whether the new password meets its policy.
Before you start #
- Use a session for the account whose password you want to change.
- Make sure authd and that account's authority are available.
- Keep any credentials needed to verify your identity ready.
Change the password #
-
Start the conversation:
-
Answer the prompts in the order shown. Terminal password input is not echoed. The authority can request several rounds of credentials.
-
Wait for the result before retrying. A refused change reports that the password is unchanged; a lost connection after submission can leave the outcome unknown.
The command accepts no account name. To administer another local account,
use lps password; see lps(1) for that command's requirements.
The local principal source requires an accepted current password for this self-service change. An ordinary account without one needs an administrator to set its password and choose the appropriate credential policy. A service principal does not become a personal account through this operation.
A password change does not mint a replacement token or end existing sessions. On the desktop, My Settings provides a client for the same credential-change conversation. For the API, use Self-Service Operations.
Check the result #
A completed change prints password changed. If the outcome is unknown,
verify the account's state before attempting another change. The client
does not automatically replay a submitted request.
Providing input through a pipe #
When standard input is not a terminal, passwd reads one line per prompt
and does not print prompts for those lines. This requires knowing the
account authority's conversation; a different policy can request different
credentials or more rounds. Avoid putting passwords in shell history,
command arguments, or ordinary temporary files. See passwd(1) for the
command interface.
Inspecting and Ending Sessions
Peios / Using Peios / Local Accounts
Use logonse to inspect logon sessions and the processes associated with
them. Ending a session asks authd to sign it out; destroying an empty kernel
session is a different administrative operation.
Before you start #
- Save work in any session you intend to end.
- Use an account allowed to inspect the relevant processes. A complete kernel session listing needs access to the kernel's session list.
- To end a session, run authd and use an account allowed by its session-end policy. You can request termination of your own eligible sessions.
Inspect a session #
-
List sessions visible to you:
-
Note the numeric session ID, then inspect it. Replace
1007with the ID from your listing:
The process listing contains only processes whose tokens you can inspect. It is a snapshot gathered while processes can start or exit. If the kernel session list is inaccessible, the command reports the limitation and uses visible processes to identify sessions. A session with no visible processes can still be held alive by a token.
Request a sign-out #
-
Check permission without ending the selected session:
-
After confirming the session ID and saving its work, request sign-out:
The check does not reserve permission. Authd checks the actual request
again. Service sessions end when their service stops; use svctl stop
for that task. The kernel's own sessions cannot be ended this way.
Check the result #
Read the reported counts and any refusal. A nonzero remaining count means the session is still open. When ending the caller's own session, the reply can describe planned termination before the caller exits. If the connection is lost after submission, verify the session state before retrying.
Run logonse list from another session to inspect the resulting state.
Token references can keep a session alive after its visible processes exit.
Other administrative operations #
logonse create creates a privileged kernel authentication record; it is
not a way to authenticate a user. logonse destroy removes an empty
session with no remaining token references. logonse psb inspects or changes
process security settings, which have separate permission requirements.
See logonse(1) for these interfaces and the JSON output option.
Interpret session evidence #
A process or thread's token statistics contain auth_id, the key used to
join it to a kernel logon-session record. Looking at primary tokens answers
which session the processes run under. Looking at effective thread tokens
answers which session an impersonating request uses. These are different
counts, neither of which enumerates every open token handle.
SYSTEM session 999 and Anonymous session 998 are bootstrap records, not unexpected interactive sign-ins. An authentication record can also exist before a token has been attached to a process.
The kernel's kacs.session.destroyed event records teardown after the last
references are released. Its deferred emission can follow disappearance
from the live list. Collection gaps mean an event stream cannot establish a
complete session history by itself. Authd does not retain a complete queryable
record of the grants and policy used for every past authentication.
Token expiration metadata is not a kernel timer or an AccessCheck revocation rule. A session-end request coordinates termination of its primary-token processes; it does not invalidate a token handle held elsewhere. Use the kernel lifecycle reference for those limits. For process protection, see Inspecting Process Security.
Granting Access
Peios / Using Peios / Authentication
authd reads local machine policy to decide which privileges, integrity
level, owner, and default access rules a token receives. An account's
principal source supplies identity and group membership, not these grants.
The policy lives under Machine\Generic\Authn\Policy. The registry manual for
that path owns the value types, defaults, and combination rules. Use
authd.regman when editing it.
Match policy to an identity #
Each principal-policy subkey names a well-known identity or a literal security
identifier (SID). Use the SID for a local account or group. authd does not
resolve a local group name while evaluating policy.
A record named Administrators refers to the built-in group. The spelling
BUILTIN\Administrators cannot be one subkey name because the backslash
separates registry keys.
Avoid two subkeys that resolve to the same SID. Their grants can combine, while conflicting scalar choices can depend on evaluation order. Keep one record per identity and investigate authd's duplicate-record warnings.
Start from the complete policy #
An existing policy key is the complete source of privilege grants. Its records are not merged with an invisible set of compiled grants.
If the whole key is absent, authd uses a small compiled floor granting
SeChangeNotifyPrivilege to Everyone. If the key exists but cannot be read,
authd grants nothing from that fallback. Deleting a policy key is therefore
not a safe way to remove all access.
The shipped authd-policy.reg supplies explicit machine defaults. It is inert
until image policy applies it. Installing the file does not prove that the
machine has those values.
Combining grants #
Privileges combine across the user and the applicable groups. The
machine-wide DeniedPrivileges mask is applied afterward, so another group
cannot restore a masked privilege.
Scalar settings do not follow that union rule. A value explicitly set on the user's record takes precedence for that value. Otherwise, integrity uses the highest configured group level. Conflicting group choices for an owner or a default discretionary access control list (DACL) produce a diagnostic and fall back rather than selecting an arbitrary group.
For example, a user record setting integrity to Low can lower the result
even when a group record specifies High. A user record specifying only
privileges does not suppress the groups' integrity settings.
Defaults for newly created objects #
A token's DefaultDacl supplies access rules when object creation has no
explicit or inherited DACL. It is not a rewrite of objects the account
already owns. Without a usable default, an object with no other DACL can
receive a null DACL, which does not restrict discretionary access.
Use OWNER RIGHTS (OW) when a default DACL should name the eventual
owner. CREATOR OWNER is an inheritance placeholder and does not provide
the same substitution in this fallback path. The shipped policy includes a
parseable default; an invalid replacement is diagnosed and omitted rather
than making every sign-in fail.
After editing policy, inspect a freshly issued token with token show --all, and test a disposable object through the application that will create
it. Check both inherited access and the fallback case. A successful sign-in
alone does not verify the intended access rules.
Separate the access checks #
A sign-in client must pass more than the account's credential check:
- The socket's security descriptor must allow it to connect.
- AuthenticationSecurity must grant the connected token the Logon right.
- Its own identity must be allowed to originate the requested logon type.
- The target account and principal source must allow that logon and its credentials.
The LogonTypes value in a principal-policy record controls what the
requesting process can originate. lps logon-types controls the account being
signed in. Changing one does not change the other.
Originator policy matches the peer token's user SID, not its group memberships. A service SID used as the user of a virtual service account can match; merely carrying the SID as a group is insufficient. SYSTEM has an explicit default Logon ACE and no additional caller logon-type restriction.
Authenticate uses a separate operation right and creates no OS session or token. It shares credential verification with Logon, then discloses the requested, permitted source groups and claims. It does not interpret those claims as permission to use a Wi-Fi network or another application.
For a virtual service account, configure capability names under its literal service-SID policy record in Capabilities. peinit requests its service token from authd, which adds those SIDs as enabled token groups. The default AuthenticationSecurity descriptor maps peios.auth.authenticate and peios.auth.logon to separate operations. Neither grants disclosure by itself. Changing assignments requires a new service token, normally by restart. The registry key's security descriptor controls who can edit this policy.
Apply changes at the right boundary #
Different settings have different refresh points:
| Setting | When authd uses it | Effect on existing state |
|---|---|---|
| Token grants | When issuing a token | Existing tokens retain their grants |
| AuthenticationSecurity | Once per Authenticate or Logon request | An active conversation retains its descriptor snapshot |
| Service Capabilities | When attesting a new service token | Restart applies the assignment |
SessionEndSecurity | Each session-end permission check | A later request is checked again |
LogonSocketDescriptor | Authority startup | An existing socket is not restamped by a registry edit |
| Source registration policy | Source registration | A connected source retains its accepted configuration |
Keep a verified administrator route while changing policy. Validate a fresh request before assuming a registry edit has taken effect. For source configuration, read Registering a Principal Source.
Resolving Names
Peios / Using Peios / Authentication
authd resolves names, security identifiers (SIDs), and Unix identifiers
through its registered principal sources. This gives clients one place to ask
for the identity behind a name or number.
Names are not durable identifiers #
An account name can change or exist in more than one source. A SID names the identity itself. Store that SID when an application must remember which principal it authorized, and resolve a name for display.
For an unqualified name, authd uses configured source search order. The first matching source wins. A source that is unavailable can stop the lookup; authd does not silently choose a different person from a later source to hide the outage.
The name fields returned by this implementation use canonical bare names. Do
not construct a realm-qualified name and assume it is accepted merely because
a protocol field is named qualified_name.
Shadowed names #
Source order is explicit machine policy, not connection order. Lower
SearchOrder values are consulted first; source names break ties. Changing
that order can make the same bare name refer to a different SID.
After a successful logon, authd can warn that a later source also owns the entered name. The check uses identity queries without credentials and does not alter the granted token. Its deadline is shared across the later sources; a source that cannot answer makes the check inconclusive. Absence of a warning is not proof that a name is unique.
Investigate a warning by comparing the sources and SIDs. Do not remove an account merely because its name matches an account in another source.
Preserve failure meaning #
A lookup can report that an identity does not exist, that a source could not answer, or that the request was refused. These results require different responses. An unavailable source is not evidence that an account has been deleted.
For example, an application should keep an unresolved SID visible while reporting a lookup failure. Replacing it with a different local account or recording permanent absence would change its meaning.
Numeric identities and groups #
Sources report relative Unix identifiers. authd applies each source's configured range, checks its bounds, and returns the effective identifiers to clients. Clients should not repeat that arithmetic themselves.
Some well-known groups describe a session rather than a stored membership list. An empty member listing does not mean no token can carry that group. Likewise, a group without a Unix group identifier cannot be represented as an ordinary numeric supplementary group.
Recorded memberships can be enumerated when their source supports it.
Groups such as Everyone and Authenticated Users are added by token
derivation rather than stored as member lists. Groups such as Interactive
and Network describe a logon, so the same account can carry different groups
in two sessions. A static account-membership list cannot reconstruct every
group on a running process's token.
Native and libc clients #
Native applications use the identity operations in libauth or its
peios-auth Rust wrapper. They can inspect unavailable outcomes, withheld
fields, and incomplete enumeration results.
The repository's name service switch (NSS) module translates libc account
queries into requests on /run/ident.sock. It does not open the local
principal store or provide an independent fallback database. Its libc result
distinguishes an unavailable authority from an unknown account.
authd performs live source queries rather than keeping an identity cache. Do not assume an outage can be served from a previous successful lookup. For client handling, read Reading Identities.
POSIX Account Lookup
Peios / Using Peios / Authentication
libnss_peios.so.2 translates libc account queries into requests to authd's
/run/ident.sock. An application using getpwuid or getgrnam receives a
POSIX record derived from the same authority used by native identity clients.
The module does not open lpsd's credential store.
A limited representation #
A struct passwd has no field for token claims. A numeric identifier does
not carry a domain name. A group's empty member list cannot distinguish every
reason that membership is not enumerable. Native applications needing these
distinctions use the identity client
API.
Groups derived from a logon, such as Interactive, have no ordinary static
member list. Unnumbered groups are omitted from supplementary numeric groups
rather than all being mapped to the fallback identity. Stored account
memberships do not describe every group on a running token.
Preserve lookup failures #
The module distinguishes a record, a missing identity, a temporary source failure, and an unavailable authority. A temporary failure is not a cached answer that the account does not exist. If names stop resolving, inspect the authority and source state before changing accounts.
Before the authority is available, an application can have a valid numeric identity without a resolved display name. Display the number rather than requiring a name to perform early-boot work.
Enumeration can be incomplete when a source does not enumerate. A short
getent passwd result does not establish that every other account is absent.
Native callers can retain the response's incomplete-source information.
Requests and process lifetime #
A normal lookup asks for the fields needed by the libc call in one request. The authority resolves source ranges and group names; the module does not reconstruct them through a separate lookup for every member.
The client opens connections for individual lookups instead of sharing one across processes that can fork. Enumeration has its own cursor lifecycle. There is no independent identity cache or fallback account database in the module.
Peios' libc package fixes account lookup to this provider. Adding another
identity source is an authority registration
operation, not an
nsswitch.conf entry that bypasses the authority's search order.
The package's libc integration and the authd module are both required.
Installing the module on another Linux system does not change that system's
libc policy.
Authentication Services
Peios / Using Peios / Authentication
The authentication service set separates token creation from credential
storage. authd issues tokens, while lpsd owns local accounts and checks
their credentials. The service manager starts them from registry service
definitions.
Readiness follows the protocol #
The authority opens its client and source sockets before reporting ready. The
local source then connects to /run/psi.sock, registers, and waits for
acknowledgment before reporting its own readiness.
The shipped dependency points from lpsd to authd. authd does not wait for
every source before becoming ready, so authority readiness alone is not
evidence that a local account can sign in.
The service definitions and registration seed have distinct purposes:
| Seed | Purpose | Applied by |
|---|---|---|
authd-service.reg | Start the authority with its required identity and privileges | Image or administrator policy |
authd-policy.reg | Supply machine authentication-policy defaults | Image or administrator policy |
lpsd-service.reg | Start the local source after the authority | Image or administrator policy |
lpsd-authd-registration.reg | Permit the local source to register and define its range | Image or administrator policy |
These files are installed under /usr/share/regim/. Their presence does not
apply their contents. A machine missing a registration seed can run the
authority without accepting its intended principal source.
Keep each service's authority narrow #
authd runs with the authority needed to create tokens and establish their security state. Its package also requires the appropriate signing tier. A development binary that links successfully is not evidence that these runtime requirements have been met.
lpsd uses a distinct virtual service account. It needs access to its store and permission to emit audit events; it does not need token-creation or token-installation privileges. Its store descriptor grants access to the lpsd service identity and SYSTEM, not to every administrator.
RequiredPrivileges narrows the service token. It does not manufacture a
privilege that machine policy did not grant in the first place.
Readiness is not a security-state handoff #
The authority does not connect to a directory to fetch credentials. Sources connect to it and verify credentials; local registry policy determines the grants on the resulting tokens. A source's asserted identity is constrained by its registration, including its domain and permitted foreign memberships. A source trusted to assert an administrator membership can affect local grants through that membership. Process separation does not make a compromised source harmless.
The client receives a token and profile and starts its own session. authd does not launch its shell or set up its terminal. Service attestation is a distinct request made by the service manager.
Restarting authd interrupts new conversations but does not replace tokens already held by processes. Kernel sessions survive while their token references remain. Authority readiness does not certify that every source has registered or that central access policies have been loaded: authd does not distribute those policies.
Inspect before restarting #
Use service status and diagnostic output to distinguish an authority startup failure from a source registration failure. Restarting either can interrupt authentication requests. Keep a separate working administrator route while investigating.
Read authd(8) and lpsd(8) for daemon behavior, then follow Diagnosing
Authentication for common
symptoms. Contributor build instructions live in the repository's
docs/building.md.
The Local Principal Store
Peios / Using Peios / Authentication
lpsd keeps local identities in /var/state/lpsd/principals. The store
contains the machine's domain identifier, account and group records,
credential material, and allocation state. Losing it means losing the
identities that existing access rules name.
The lpsd-service.reg seed declares /var/state/lpsd as the required
lpsd-state entry under Machine\System\Init\ProvisionedPaths. peinit
creates the directory before phase 2, owned by lpsd's service SID, with
a protected inheritable descriptor granting full control to that SID
and SYSTEM. The image or installer must supply /var/state; peinit
does not create unnamed parents.
Identity survives names #
The machine domain is generated when a missing store is provisioned. Accounts and local groups receive relative identifiers from one counter, starting at 1000. Deleted identifiers are not reused.
A local security identifier (SID) combines the domain and relative identifier. Recreating the same account name in a fresh store therefore does not restore the old SID or the access granted to it.
Well-known group identities are defined separately. The store records memberships in them rather than inventing a local copy of their identity.
Do not bake a provisioned store into an image intended to create independent machines. Copying the store copies its domain and account identities; giving the machines different hostnames does not change those SIDs.
The stored Unix identifiers are relative. authd applies the source's
configured numeric range when issuing tokens and answering lookups. lps
displays the effective numbers. A dash in its UID column indicates that no
usable source range was assigned; it is not evidence that the account lacks
a SID.
Credential material stays protected #
The store holds password verifiers rather than plaintext passwords, along with enrolled public keys and credential policies. Password verifiers are still sensitive: a stolen copy can be used to guess passwords offline.
The lpsd virtual service account owns the credential file. Its protected discretionary access control list (DACL) grants full access to that service identity and SYSTEM. Administrator membership alone has no direct grant.
Do not widen the descriptor to make an account-management script work. Use the daemon's administrative interface, which checks the caller and keeps a single writer responsible for the store.
The password verifiers use Argon2id and retain their cost parameters. A change to the parameters for newly set passwords does not rewrite existing verifiers. Privileges and integrity levels are absent from the store: those come from machine policy.
Optional NT compatibility material #
Machine\Software\Lpsd StoreNtHashes controls an additional NT hash for
password accounts. It defaults to REG_DWORD 1 during compatibility
development. Argon2id remains present. The NT hash supports MSCHAPv2 and
NTLMv2, which SMB file sharing uses; it
is password-equivalent material and substantially cheaper to attack
offline than Argon2id. The store has access-control protection, without
an additional credential-encryption layer. Protect offline copies too.
BackfillNtHashes, under the same key, separately defaults to 1. When
both settings are enabled, a successful password check can populate a
missing NT hash while the verified password is transiently available.
This is maintenance, without another sign-in step or sign-in failure if
the save fails. Existing Argon2 records cannot be converted without the
password. MSCHAPv2 or NTLMv2 success itself cannot perform this backfill.
Setting StoreNtHashes to 0 disables NT-based verification and creation,
removes live NT material and attempts to save that removal. Old backups
are unaffected. Inspect lpsd.credential.maintained for a failed save;
memory remains disabled while durable cleanup is retried on later activity.
Malformed or unreadable settings disable legacy use without requesting
deletion. Changes are watched live and checked before source operations;
multi-value reads are not an atomic Registry snapshot.
Password set/change updates the verifiers together under current policy. Password removal removes both. Password-policy restrictions apply to PAP, MSCHAPv2, and NTLMv2 alike. Pending proofs and backfill check credential versions to reject a password reset during the exchange. NT derivation uses exact UTF-16LE with no normalization; legacy non-UTF-8 password bytes retain Argon2 verification but cannot acquire NT material through this conversion.
lps show NAME reports whether NT material is present. No administrative,
identity, or authentication API returns the stored NT hash. An authorized
MSCHAPv2 authentication returns only its exchange-specific server proof,
and an NTLMv2 one only its exchange-specific session key.
Administrative requests #
lps reaches /run/lpsd/admin.sock; it never edits the file. The socket's
descriptor and the daemon's peer-token check admit SYSTEM and enabled
Administrators membership. A deny-only administrator group does not grant
access. Making the Unix mode more permissive does not repair a KACS denial.
Each connection carries one administrative request and its reply. The daemon checks the peer before reading a request and bounds reads and writes. For a refused connection, inspect the socket descriptor and the caller's token before changing either service configuration or account data.
Use the identity interface for general account lookup and the self-service
interface for the caller's own
account. These do not require widening the administrative socket. The public
libauth client does not expose local administrative operations; lps and
the repository's administrative client implement that separate protocol.
The Local Principal Administration
specification
defines message formats. Event names and fields belong to lpsd.evman; a
successful no-op is not evidence that a change event will be emitted.
Replacement and failures #
Changes replace the whole store. lpsd creates a protected temporary file, writes and synchronizes it, renames it over the old file, and synchronizes the containing directory. Protection is established before credential bytes are written.
A successful administrative reply follows the save. A lost reply leaves the caller uncertain whether a submitted change took effect. Read back inspectable state before repeating it.
A storage error also needs investigation. In particular, failure to synchronize the directory after replacement can leave changed on-disk state even though the request reports failure. Do not assume every reported failure proves that both memory and disk retain the previous state. Stop further administrative changes and investigate the storage failure before relying on either view.
Format compatibility #
The credential-binding source reads formats 4 through 7 and writes format 7. Format 4 loads with empty group descriptions. Older password records load without NT material. Each password has an opaque reference and revision; replacement retains its reference and rotates its revision. NT-hash backfill, purging NT material, account enablement, and metadata edits do not rotate it.
Loading an older format assigns these bindings and atomically saves format 7 before exposing the store. A failed migration prevents startup. This is a specific compatibility range, not a promise that every release can read its predecessor's store. Preserve an offline copy before upgrade: older builds cannot read format 7.
Check format compatibility before replacing lpsd with an older build. Preserve the original store and its security metadata during any planned upgrade or recovery.
Missing and unreadable are different #
A missing store means an unprovisioned machine. lpsd creates a domain and an empty store, without creating an account.
An existing store that is corrupt, unreadable, or in an unsupported format causes startup to fail. lpsd does not silently replace it with an empty store. Do not delete the file to clear that error: preserve it for diagnosis and recovery.
The daemon and state paths are documented in lpsd(8).
Authentication Events
Peios / Using Peios / Authentication
Authentication events record what the authority and local source decided. They complement diagnostic logs: a source checking a credential and an authority delivering a token are separate outcomes.
Follow the decision that matters #
Use the event belonging to the stage you are investigating:
authd.logon.attempted: the authority's outcome for a logon conversation, including whether a granted token reached the client.authd.service.attested: a request for a service identity and the authority's decision.authd.session.ended: the outcome of a session-end request.lpsd.credential.verified: the local source's credential check.- lpsd account, group, and credential events: changes to the local store and credential material.
A successful credential check alone does not prove that the authority granted a logon or that the client started a usable session. Inspect the authority result and client diagnostics as well.
Use the catalog for exact fields #
The canonical event definitions are authd.evman and lpsd.evman, shipped
under /usr/share/evman/. Read them with evman for exact fields, tiers, and
outcome meanings. The source copies live under docs/ in the authd
repository.
For example, the authority's logon event omits the proposed account name on failure. Input supplied by a caller is not an authenticated identity. On success, the event identifies the granted principal by its security identifier (SID).
Interpret incomplete evidence #
An authority refusal, a transport failure, and a token that could not be delivered are different outcomes. Preserve the recorded reason rather than converting all of them into an incorrect-password count.
Event absence is not proof that nothing happened. Access to records, emission policy for configurable tiers, and collection failures can affect what you can see. Check service diagnostics when a required record could not be emitted.
Do not add credential values to diagnostic messages to investigate a failure. Account and session identifiers, operation names, and the documented outcome fields provide the correlation data.
Registering a Principal Source
Peios / Using Peios / Authentication
Register a principal source when authd must accept identities from that service. A source connects to authd; the authority does not discover or trust it merely because its process is running.
Before you start #
Check these prerequisites:
- Use an authorized machine-configuration route.
- Preserve an existing administrator session.
- Confirm that the source implements the Principal Source Interface and runs with the service identity named by its registration.
For the shipped local source, the supplied lpsd-authd-registration.reg seed
describes the expected configuration. Review that seed and authd.regman
before applying image policy.
Configure and verify registration #
Follow these steps:
-
Under
Machine\Software\Authd\Sources, create or review the subkey for the source's service name. For the local source, that name islpsd. -
Verify that the service's token carries the corresponding service security identifier (SID). The subkey name identifies the permitted service; a source cannot establish its identity by claiming that name in a message.
-
Choose the source's numeric range and search order. If a fixed identity domain is required, configure its expected domain SID. Follow the types and constraints in the registry manual rather than copying another machine's generated domain.
-
Start or deliberately reconnect the source through service management after the authority is ready. Inspect its service status and diagnostics for an accepted registration.
-
Verify a lookup and a fresh permitted sign-in for an account from that source. A process that exists but has not registered cannot satisfy authentication requests.
For lpsd, readiness is reported after authd acknowledges registration. Its
service definition therefore depends on authd, not the reverse.
Keep identity and membership authority distinct #
A source's declared domain limits which identities it can assert. Numeric range checks also prevent its relative identifiers from escaping into another source's range.
MayAssertForeignMemberships concerns group membership assertions. It does
not authorize the source to authenticate identities in another domain. Grant
it only where the source is trusted to provide those memberships; the local
source has that role in the shipped configuration.
An absent or unusable Unix ID range does not cause authd to guess one. The unconfigured projection uses the fallback identity number. Verify the configured range before relying on numeric identity lookup.
Changing a registered source #
authd reads the allowlist during registration. A live registered source retains its accepted domain, range, search order, and membership grants. Editing or deleting its registry entry does not immediately revoke that connection.
Plan reconnection when changing those settings. Reconnecting cannot change a source domain already recorded during the running authd process's lifetime. A source interruption can make identity queries and sign-ins unavailable, so use an access route that does not depend on the source being changed.
The exact registry values belong to Machine\Software\Authd\Sources in
authd.regman; shared protocol requirements belong to the Principal Source
Interface specification.
Diagnosing Authentication
Peios / Using Peios / Authentication
Diagnose the stage that failed before changing account or machine policy. A denied credential, a refused socket connection, and an unavailable principal source are different failures.
Before you start #
Prepare the investigation:
- Keep a working administrator session open.
- Record the operation, account, client, and error text. Do not copy passwords or private keys into a log.
- Use read-only checks before restarting a service or changing policy.
Locate the failing stage #
Follow these steps:
-
Check whether the authority and local source are ready:
-
From an authorized administrator session, inspect the target account with
lps show <name>. Check its state, logon types, credential policy, and available credential material. -
Compare the failing operation with the symptom table. Inspect the relevant service diagnostics or event record before making a change.
-
Make one justified change through the appropriate interface, then repeat a fresh request through the original client.
Match the symptom #
The symptom identifies a useful next check:
| Symptom | Check | Do not infer |
|---|---|---|
lps cannot connect | lpsd readiness and the admin socket's descriptor | Unix mode bits alone determine access |
lps refuses the caller | The caller's active administrator membership or SYSTEM identity | Executing an administration command grants its rights |
| Sign-in source unavailable | Registration, source readiness, and connection diagnostics | The account does not exist |
| Credentials refused | Account state, permitted logon type, policy, and supplied proof | Every refusal reveals whether the name exists |
| Key works but console fails | Whether the account is key-only | Terminal login supports SSH key proof |
| Sign-in succeeds but home fails | Recorded path, parent directory, owner, and descriptor | Another sign-in will repair an existing directory |
| Registry edit appears ineffective | That setting's refresh boundary | Every setting is reread on each request |
Separate connection permission from operation permission #
Reaching /run/logon.sock does not authorize a client to originate every kind
of logon. The authority checks the connected caller and the requested
operation. Similarly, reaching the self-service socket does not authorize an
operation on someone else's account.
For originator refusals, inspect Authentication Policy. For registration failures, inspect Registering a Principal Source.
Handle failed changes carefully #
If a connection is lost after an account change was submitted, inspect the state before retrying. The operation might already have succeeded. If the daemon reports a storage failure, preserve its diagnostics and investigate the filesystem before making further account changes.
Do not delete the principal store to repair a startup failure. Read The Local Principal Store for why replacing it changes the machine's identities.
Check the result #
A successful status query or account listing is only one part of the check. Verify a fresh sign-in through the intended route and confirm the resulting access before closing the administrator session used for repair.
Security Identifiers
Peios / Using Peios / Identity and Access
A security identifier (SID) is the value Peios uses to identify a principal: a user, a group, a service, the machine, or a built-in identity such as Everyone. Every permission on every object names SIDs, and every running program carries SIDs that say who it is. When you read a permission or diagnose a refusal, you are comparing SIDs.
Reading a SID #
A SID is binary, but tools show it as a string that starts with S-1:
S-1-5-21-3623811015-3361044348-30300820-1013
The parts after S-1 are numbers assigned by an authority. The 5 here is
the authority, and the numbers after it narrow down to one principal. The last
number is the relative identifier (RID), which tells principals apart within
the same domain. Short SIDs belong to identities that every Peios system
shares:
| SID | Identity |
|---|---|
S-1-5-18 | Local System, the operating system's own identity |
S-1-5-32-544 | The built-in Administrators group |
S-1-1-0 | Everyone |
These shared SIDs are called well-known SIDs. Well-Known SIDs lists the ones you meet most often.
Names are labels #
An account's name can change. Its SID doesn't. Renaming an account keeps its SID, so every permission that names the account still applies to it. A deleted account's SID is never given to another account, so old permissions can't start granting access to a stranger.
For the same reason, compare SIDs rather than names when you check who has access. Two different strings can spell the same SID, and a name only tells you what a tool chose to display.
A SID on its own doesn't tell you what a principal can do. Group membership, privileges, and the other details of a principal's authority come from the access token it runs with.
SIDs that aren't accounts #
Some SIDs identify something other than a person or a group:
- Service SIDs identify one service, written by name as
SERVICE\loregd. A service's programs carry its service SID as a group, so a permission can admit one service without admitting everything that runs as the same account. - Logon SIDs identify one sign-in or other logon, in the form
S-1-5-5-X-Y. They let a permission admit one session without admitting every session of the same account. See Logon Sessions. - Integrity labels, in the form
S-1-16-n, mark a level of trust. See Integrity Levels. - Placeholders stand in for another identity in a permission. When a new object inherits a permission that names Creator Owner, for example, the new object's owner takes its place.
Where SIDs are defined #
The Peios Common Data Structures specification defines the SID format and the complete catalog of well-known SIDs. It is the authority for every assigned value.
Access Tokens
Peios / Using Peios / Identity and Access
An access token is the identity a running program acts with. Each thread in a program carries one, and every time the thread opens a file, reads a registry key, or sends a signal, Peios checks the request against that token. The token, not the account name a program displays, decides what the program can do.
What a token holds #
A token holds the facts Peios needs to decide a request:
- The user. The security identifier (SID) of the principal the token represents.
- Groups. The SIDs of the groups the principal belongs to, and the logon SID of its logon session.
- Privileges. The system operations the principal can perform. See Privileges.
- An integrity level. A level of trust that limits what the token can change. See Integrity Levels.
- Defaults for new objects. The owner and permissions that objects the program creates receive.
Some of these fields can be adjusted while the token is in use. A program can turn one of its privileges on or off, or turn a group off. The identity fields, such as the user, the set of groups, and the integrity level, can't be changed after the token is created.
To see the token a program is using, run token show. See
Inspecting Effective Identity.
How a program gets a token #
A program can copy its token or make a weaker version of it, but creating a token for an identity is reserved for the kernel and two trusted programs, authd and peinit. Tokens come from three places:
- At boot, the kernel creates the token for the operating system's own identity, Local System. The service manager, peinit, starts with it.
- At sign-in, authd, the authentication service, checks your credentials against policy and creates a token for you. The program you signed in through, such as the console or the desktop, starts your session with it.
- For a service, peinit gives the service's first program the token for the service's account.
After that, a new program inherits a copy of its parent's token. Running another program file keeps the same token, unless the file is marked to run at a lower integrity level. So everything started from your desktop or your shell runs with the identity you signed in with.
Primary and impersonation tokens #
A program's own token is its primary token, and its threads share it. A thread can also take on another token for a while, which is called impersonation. A service uses impersonation to act for a client: it handles the client's request with the client's identity, so the request can do only what the client could do. When the thread stops impersonating, it returns to the primary token.
A new program never inherits impersonation. It starts with its parent's primary token.
Account changes and running programs #
A token records the account as it was when the token was created. Changing an account afterward, for example adding it to a group, disabling it, or changing its privileges, doesn't change tokens that already exist. Programs already running keep their previous access.
To pick up a change, start a new sign-in. To stop a running session, end it: Inspecting and Ending Sessions covers the command and what it reaches.
The kernel's token model describes every field and operation.
Privileges
Peios / Using Peios / Identity and Access
A privilege lets a program perform a system operation that has no object to put a permission on: shutting down the machine, setting the clock, or loading a kernel module. Permissions live on objects, and privileges live on the program asking. Some privileges also let a program reach objects in ways their permissions alone wouldn't allow, such as reading a file for a backup.
Policy assigns privileges #
Privileges come from machine policy, not from who you are. Belonging to the
Administrators group gives an account no privilege by itself. When you sign
in, authd reads the policy under Machine\Generic\Authn\Policy, combines the
privileges granted to your account and to each of your groups, and puts the
result in your access token.
The policy that Peios ships gives every account a small set of privileges
and gives Administrators many more, such as SeShutdownPrivilege and
SeBackupPrivilege. It deliberately gives no one the privileges that create
or install tokens. Granting Access
explains the policy and how to change it.
A token keeps the privileges it was created with. A change to policy reaches only tokens created after it, so sign in again to pick it up.
Privilege states #
A privilege on a token is in one of these states:
- Present. The token has the privilege. A privilege can't be added to a token after it is created.
- Enabled. The privilege is in effect. A program can use a privilege only while it is both present and enabled. authd creates tokens with every granted privilege enabled.
- Removed. The privilege is gone from the token for good. Removing a privilege can't be undone, unlike turning it off.
A program that needs a privilege only for a moment can turn it off when it is done, or remove it, so a later mistake can't use it.
Common privileges #
These are the privileges you are most likely to see in a token or a policy:
| Privilege | Allows |
|---|---|
SeChangeNotifyPrivilege | Passing through directories without permission to each one. Every account has it. |
SeShutdownPrivilege | Shutting down or rebooting the machine |
SeRemoteShutdownPrivilege | Shutting down or rebooting from a remote session, in addition to SeShutdownPrivilege |
SeBackupPrivilege | Reading any object for a backup, whatever its permissions |
SeRestorePrivilege | Writing any object to restore a backup, whatever its permissions |
SeTakeOwnershipPrivilege | Taking ownership of any object |
SeSecurityPrivilege | Reading and changing an object's audit settings |
SeSystemtimePrivilege | Changing the system clock |
SeImpersonatePrivilege | Acting for a client with the client's identity |
SeManageVolumePrivilege | Mounting and managing volumes |
SeLoadDriverPrivilege | Loading and unloading kernel modules |
SeDebugPrivilege | Inspecting and attaching to any process, whatever its permissions |
SeTcbPrivilege | Operations reserved for the system's most trusted components |
Privilege names are case-sensitive: write them exactly as shown.
A privilege doesn't override every protection. SeBackupPrivilege and
SeRestorePrivilege apply only when a program asks for backup or restore
access explicitly. Neither they nor SeDebugPrivilege bypass Process
Integrity Protection, which guards trusted processes and the objects labeled
for them.
The kernel's privilege catalog is the complete list, with each privilege's exact effect.
Logon Sessions
Peios / Using Peios / Identity and Access
A logon session records one occasion on which Peios established an identity: you signing in at the console, an SSH connection, or a service starting. Every access token belongs to exactly one logon session, and every token copied from it shares the same session. Knowing which session a program belongs to tells you how its identity was established, and lets you end everything that came from one sign-in together.
A logon session is separate from a terminal's session and from a desktop session: the word "session" names different things in each.
What a session records #
authd creates the logon session before it creates the first token for it. The session records:
- the user's security identifier (SID);
- the logon type, which says how the session began;
- the time it was created;
- an identifier that is unique while the machine is running.
The session's logon SID, in the form S-1-5-5-X-Y, comes from that
identifier and is placed in the groups of every token in the session. A
permission can name the logon SID to admit one session without admitting the
account's other sessions. The identifier can recur after the machine
restarts, so don't use it as a lasting record of an account.
A session lasts as long as any token that belongs to it.
Logon types #
The logon type describes the situation, not the account: one account can have sessions of several types at once.
| Logon type | Session begins when |
|---|---|
Interactive | Someone signs in at the machine's console |
RemoteInteractive | Someone signs in from another computer, over SSH or to a desktop in a browser |
Network | A program on another computer authenticates to use a service here |
NetworkCleartext | As Network, marked as using a credential that was sent unencrypted |
NewCredentials | A program keeps its identity on this machine, marked as using other credentials for connections to other computers |
Batch | A scheduled job starts |
Service | A service starts |
Every SSH connection is RemoteInteractive, including a single command run
without a terminal. The names of the two variants describe their purpose, not
what happened: NetworkCleartext doesn't prove that credentials crossed the
network unencrypted, and NewCredentials doesn't make Peios forward
credentials anywhere.
Sign-in policy can permit or refuse each logon type for an account; see Granting Access.
Ending a session #
Ending a logon session stops the programs whose primary token belongs to it. authd asks them to stop, then forces them. A program elsewhere that holds a copy of one of the session's tokens keeps the session alive, so ending it doesn't revoke every use of its identity. The Local System and service sessions can't be ended this way.
Inspecting and Ending Sessions describes the
logonse command.
Integrity Levels
Peios / Using Peios / Identity and Access
An integrity level ranks how far Peios trusts a program or an object. Every access token has one, and objects can carry one. Before Peios reads an object's permissions, it compares the two levels. A program at a lower level can't change an object at a higher level, even if the object's permissions would otherwise allow it. A program handling untrusted input can therefore run at a low level, so that a fault in it can't change the system's own files and settings.
The levels #
Five levels are standard:
| Level | Value | Used for |
|---|---|---|
| Untrusted | 0 | Code in a sandbox |
| Low | 4096 | Services handling untrusted input |
| Medium | 8192 | Ordinary sign-ins and most services |
| High | 12288 | Administrators |
| System | 16384 | The kernel, peinit, and the system's most trusted services |
A level is written as a security identifier (SID) in the form S-1-16-n,
where n is the value. Peios compares the numbers, so a value between two
standard levels is valid too.
Your sign-in gets its level from machine policy. A token is Medium by default, and the policy that Peios ships gives Administrators High. A token's level can't be changed after it is created. A program file can be marked to run at a lower level than its parent, but nothing raises a running program's level.
The integrity check #
Each object can carry a label with its level. An object without a label is treated as Medium.
By default, a program can read an object at a higher level but can't write to it. A label can also stop a lower-level program from reading the object or running it. The integrity check comes before the object's permissions, and it can only take access away: a permission can't grant what the integrity check refuses. Rights that come from a privilege aren't removed by it.
Integrity and process trust #
Integrity levels are a property of the token, so they follow the identity a program acts with. Process Integrity Protection is a separate mechanism that follows the program itself, based on the signature of its program file. See Process Trust.
The kernel documents mandatory integrity control in full.
Identity and Authority
Peios / Using Peios / Identity and Access
An account record describes a principal. Authentication establishes which principal is requesting a sign-in. A token carries the runtime identity and authority used by a thread. An access decision combines that token with the object, requested operation, and applicable policy. None of these steps is interchangeable with the others.
A name is not a grant #
A security identifier (SID) identifies a principal. Resolved names are labels; compare parsed binary identities rather than names or a domain prefix. A SID alone does not reveal group membership, privileges, integrity, or whether an account is signed in. Different accepted text spellings can represent the same parsed SID; formatting differences alone do not establish inequality.
Use PCDS's SID reference for encoding and the well-known catalog for assigned identities. Avoid maintaining another numeric catalog in application documentation.
For policy, distinguish the intended audience: Authenticated Users is not Everyone, a service identity is not every process of its hosting account, and a logon SID identifies one authentication context rather than the account across sign-ins. Creator Owner is an inheritance placeholder; Owner Rights controls the owner's special grants on the object being checked. Integrity and process-trust labels belong to their mandatory-policy mechanisms, not ordinary group membership.
Accounts become runtime tokens #
Local account records, source resolution, and authentication policy participate in sign-in. Token creation is privileged; the kernel does not independently prove the truth of every claim a trusted creator supplies. Changing an account record does not rewrite tokens already running.
A token carries a user SID, groups and their attributes, privileges, integrity, claims, restrictions, and session context. A privilege is a grant for specific operations, not a substitute for identity. Integrity constrains categories of access. Process Integrity Protection belongs to the executing program's PSB, so impersonating another identity does not change program trust.
Claims are typed attributes. Token user/device claims, caller-supplied local claims, and object resource attributes have different provenance. A missing claim can evaluate to UNKNOWN: it does not satisfy a conditional allow and can preserve a conditional denial. Do not substitute an empty value for absence or treat a display label as a trusted claim. The condition specification defines the logic.
Follow the effective thread #
A process's primary token is the default identity for its threads. A thread handling a client can temporarily impersonate another token. Diagnose the thread that performed the operation, not only the account displayed for the process. Reverting returns to the primary token; it does not change the process's program protection.
Token fields and operations are defined in the kernel's token model. Identity fields cannot be arbitrarily relabeled by adjustment. Duplication, restriction, privilege adjustment, and primary-token installation have different gates and effects. A privilege can be disabled or removed; removal is not the same as a reversible disable.
Fork gives the child an independent copy of the parent's primary token, without inheriting an active impersonation. Threads share the primary token but have independent impersonation state. Exec reverts impersonation and normally retains the primary token, subject to the documented integrity lowering rule. See Token Lifecycle for installation convergence and exact transitions.
Authentication sessions and elevation #
A logon session records an authentication context shared by its tokens. It is separate from a terminal's job-control session and from an interactive environment scope. Do not use a boot-local session identifier as a durable account identity or assume its value cannot recur on another boot.
A session's type records how it was created. Local console authentication, remote SSH/GXWI sign-in, and service launch have different provenance. The type is not a blanket access grant; token groups and specific kernel operations give it effects. A NetworkCleartext name alone does not prove a password traversed an unencrypted network, and NewCredentials metadata does not implement an outbound credential broker by itself.
A linked Full/Limited pair is a kernel mechanism available to a trusted broker. It does not establish that every interactive sign-in uses a pair, that a consent interface exists, or that the caller can install its partner. The role can remain after the active link disappears. Use the linked-token reference and the actual broker's documented workflow.
Ending a session coordinates its processes; it does not revoke every token handle held elsewhere. Token expiration metadata is not a kernel access-check timer. Follow Inspecting and Ending Sessions for the supported command and its completeness limits.
Privilege state and operation authority #
A token can have a privilege present but disabled. Enabling a present privilege is different from adding one; permanently removed privileges cannot be re-enabled on that token. Enabled-by-default state is a creation property, and the used bit records exercise rather than a timestamped use history. Consult the privilege model and adjustment rules before interpreting or changing those states.
Some privileges gate kernel operations directly, some contribute rights in AccessCheck, some are interpreted by services, and some names are reserved. A name in a catalog does not prove enforcement by every component. Backup and restore contributions require the relevant intent as well as enabled privileges; the object manager's actual open/update path supplies its own context. PIP, confinement, and central policy can still constrain grants. Removing privileges and adding restricting SIDs are separate reductions.
Diagnosing an Access Refusal
Peios / Using Peios / Identity and Access
A refusal can be the intended policy working. Start with evidence from the failed operation; a token dump or an isolated allow ACE cannot explain every possible access decision.
Gather the actual request #
- Record the operation, time, message, and exact error or exit status. Identify the process, failing thread, and managing service where known.
- Identify the object and requested rights. Keep a registry key separate from its value name. Distinguish a link from its target and an open from an operation using an already-open handle.
- Inspect the relevant effective token with existing authority. Preserve target selectors and the observation time: impersonation can have ended before inspection. Without a target, a tool usually observes itself.
- Read the descriptor components available to that caller. Mark unreadable or undisplayed components as unknown, not empty.
- Correlate recorded evidence and its collection limits. After a reviewed correction, repeat the original operation in its intended context.
An application can request more rights than its visible action suggests. Capture the exact mask when diagnostics provide it. Rights on an existing handle reflect the earlier open; today's descriptor does not reconstruct that earlier decision.
Choose a supported view #
| Question | Read-only starting point | Limit |
|---|---|---|
| Process identity | token show --pid PID --all | Primary token, not necessarily the failing thread's effective token. |
| Impersonating thread | token show --pid PID --tid TID --all | Consecutive live queries cannot reconstruct an earlier token. |
| Present/enabled privileges | token privs --pid PID | Presence does not prove enablement, intent, or successful use. |
| Program protection | logonse psb --pid PID | PSB summary, not the process's security descriptor. |
| Session context | logonse list and logonse show ID | Can fall back to an incomplete visible-process view. |
| File descriptor policy | sd show PATH --all | Owner, group, DACL, and label subset; not a complete SACL export. |
| Registry descriptor | reg sd KEY, with --sacl when authorized | Default output omits SACL policy. |
| Recorded attempt | Event Viewer or evctl | Reader rights, collection, query scope, retention, and transport can limit evidence. |
For files, sd follows a named symlink unless its documented no-follow
option is selected. Inspect the same object the application meant to use.
Token pseudo-files provide handles, not text to print with cat.
Token inspection and
process-security inspection
explain their separate access gates.
Rehearse within the tool's limits #
For an identified file and process, a read rehearsal is:
Adapt the file, rights, and PID to the failed request. This does not perform the file operation. A tool failure is different from a completed denied check. The process selector does not reproduce every thread impersonation, local claim, backup/restore intent, object mapping, or PIP context. It also does not test an existing handle's rights.
An allowed rehearsal is therefore not proof that the application must succeed. If the results differ, compare inputs and timing before changing policy. A developer can use the SDK request reference for inputs the operator tool cannot supply, and its checking guide for the advisory result's limits.
Review the relevant policy #
| Evidence | Review |
|---|---|
| Identification-level impersonation token | Whether the client conveyed authority and the server was admitted to use it. |
| Mandatory-integrity refusal | Token integrity/mandatory policy, the applicable object label, and requested mapped rights. |
| Process-trust refusal | Calling PSB, target trust label, and intended signed interface; impersonation does not raise PIP. |
| Missing privilege contribution | Present versus enabled state and required operation intent. |
| DACL refusal | Ordered ACEs, enabled/deny-only SIDs, conditions, inheritance-only flags, and owner-rights suppression. |
| Restricted-token narrowing | The independent restricting SID view and any retained privilege grants. |
| Confinement narrowing | The intended confinement identity/capabilities and resource policy. |
| Central-policy narrowing | Effective policy, applicability, resource attributes, and recovery behavior; staged mismatches are separate evidence. |
MIC, PIP, privilege contributions, and narrowing occur in a defined pipeline. Do not assume one label mismatch or one matching ACE explains the whole mask. The kernel access-check reference is authoritative for ordering. Object-manager and service checks can also reject an operation outside that pipeline.
Interpret recorded evidence #
kacs.audit.access.checked can record the subject, object, requested and
granted masks, and reasons. Auditing depends on policy; userspace checks
also have audit-authority requirements. One check can produce several records.
A successful MAXIMUM_ALLOWED result does not prove a particular bit was
granted. Inspect the returned mask.
Use Finding Missing Records before interpreting an empty search. Raw KMES inspection is a transport probe, not historical proof. Preserve refused inspections, missing inputs, and changed-state uncertainty in the report to the application or policy owner. A narrower intended grant or corrected caller behavior should follow that review; broad permission changes are not a diagnostic substitute.
Interpreting Audit Evidence
Peios / Using Peios / Identity and Access
Use audit evidence to reconstruct a particular operation. Start with its process instance, effective subject, object, requested rights, result, and observation interval. Preserve the original record before translating SIDs or event fields into display names.
Identify the trigger #
| Trigger | What the record establishes |
|---|---|
| Access audit ACE | A matching SACL rule observed an access check and outcome. |
| Continuous alarm ACE | An operation overlapped the audit mask retained on its handle. |
| Token object-access policy | The checked token required a success or failure record, even without a matching SACL ACE. |
| Privilege-use policy | A privilege contributed rights, with success or failure determined after the narrowing passes. |
| Central policy diagnostic | A SACL could not be evaluated or staged and effective policy differed. |
Audit rules do not grant or deny access. Their success and failure flags select observations. Conditional audit expressions that are UNKNOWN use the conservative audit behavior; ordinary conditional allow rules differ. An inherit-only ACE is a template for children, not an immediate observation rule on the parent.
Continuous records identify the operation-time subject, which can differ from the opener after impersonation or descriptor transfer. Their stored audit mask comes from the open. Changing the object's SACL does not turn every existing handle into a fresh open with the replacement mask.
Preserve the limits of attribution #
The token ID, authentication ID, process GUID, and PID identify different things. Resolve names as annotations; do not replace original SIDs. A process can act with an impersonation token, and a single logon session can contain many tokens. Cross-boot correlation needs boot context.
A userspace AccessCheck record is an advisory check of caller-supplied data, not proof that the kernel opened that object. Its userspace-attestation marker matters. On that syscall path, SACL-generated records require the emitter's enabled audit privilege; token-policy and other event families have separate rules. The kernel audit reference defines these distinctions and the event schemas define the fields. Absent object information must remain unknown.
Do not treat a privilege-use record as proof that removing that privilege would have denied the operation. Backup and restore accounting can record a contribution even where the DACL independently permits access. Maximum-access queries also differ from concrete operation requests.
Check delivery before drawing conclusions #
A required event-construction or delivery failure can fail an audited call; auditing is not universally best-effort. Transport buffering, loss, persistence, retention, and query permissions are separate stages. Neither a successful call nor an empty event query establishes a complete history.
Collect both the event and any loss or ingestion diagnostics for the same interval. Check query scope and retention, and distinguish an inaccessible field from an absent field. Follow the event evidence workflow for collection and the raw event catalog for schema interpretation. A sequence gap alone in a filtered view is not proof of loss.
Inspecting Effective Identity
Peios / Using Peios / Identity and Access
token exposes the identity and authority carried by running processes and
threads. It is a diagnostic tool for questions that a user name or numeric
group list cannot answer.
Choose the identity being observed #
A process has a primary token. A thread can have an impersonation token that supplies its effective identity. A peer-token query observes identity captured on a connected socket, which is another distinct target.
Reading another process's token requires the appropriate access. Knowing a process number or a socket descriptor does not bypass that check.
Use an explicit selector when diagnosing another program:
Replace the process and thread IDs with identified targets. The process view
selects its primary token; the thread view matters for impersonation.
--self is the default, --real selects the caller's primary token, and
--peer SOCK_FD selects captured identity on a connected socket. A peer query
is not a lookup of whatever identity its process happens to use afterward.
Preserve the selector, time, token ID, and modification ID with observations.
Use --json for structured output and the documented raw-SID/label display
choices when comparing identities. These queries do not authorize mutation.
Read more than the user name #
Token state includes security identifiers (SIDs), group attributes, privileges, integrity, and logon information. A deny-only group can deny access without granting it, even when its friendly name matches an ordinary membership elsewhere.
The logon-session identifier and the interactive-environment scope are separate fields. Changing a scope is not the same operation as moving a token into a different authenticated logon session.
Field commands also expose integrity, logon context, claims, capabilities,
origin/source, and creation defaults. Apply the same target selector to each.
A default DACL concerns new objects, not the descriptor of every existing
object. show --all means all supported query classes, not every internal
field. Absence of an internal field from the output does not establish its
value; the kernel's query reference owns that boundary.
Full or Limited elevation type can outlive the active link. token linked
queries a counterpart where one exists and is accessible; a role alone is
not evidence that elevation is available. The privilege used bit is not a
timestamped record of each exercise.
Compare observations carefully #
Token comparison reports selected identity, group, and privilege state. Equal and different comparisons can both succeed: the status indicates whether the queries worked, not whether the tokens matched.
Thread enumeration can race with thread exits or access changes. A failed row makes the result incomplete and is reported rather than silently removed. Multiple queries are consecutive observations, not one atomic snapshot of all token state.
Derived tokens remain controlled objects #
Restriction, duplication, adjustment, and impersonation have different purposes. A restriction limits an existing authority; it does not grant a new one. Creating or installing identity requires the corresponding privilege and is not a normal way to switch users.
token(1) defines target selection, comparison output, thread failures, and
the mutation interfaces. Use the normal authentication workflow when your goal
is signing in rather than testing a token mechanism.
Refused and partial views #
A cross-process token query needs process-query rights, PIP dominance, and
query access to the token. Own-process /proc query-only token paths have a
special rule; direct self-open APIs still check the token descriptor.
Do not generalize one surface's self-access exception to every operation.
Process walks cannot enumerate all tokens held only by file descriptors. A missing target, denied query, and invalid request are different failures; none is a successfully read empty token. Token pseudo-files are handles, not text files. SDK users should follow the opening reference and query protocol.
Inspecting Process Security
Peios / Using Peios / Identity and Access
Use logonse psb --pid PID to inspect a process's protection, mitigation
mask, and Process GUID. Replace PID with the current process number.
Omitting mutation options leaves those settings unchanged.
Inspect and correlate #
- Identify the current process and its workload. Record its Process GUID when correlating historical events; a PID can be reused.
- Read its PSB with
logonse psb --pid PIDor Task Manager. Limited query access can expose the protection level even when detailed inspection or process control is refused. - Inspect the primary token to identify the process's account and session. Inspect the particular thread's effective token if impersonation matters.
- Read the process descriptor using the supported SDK surface when the question is who can act on it. The DACL and SACL have different access requirements; a limited PSB read is not permission to read both.
- Correlate current state with stored events. Separate reads can observe different moments and do not constitute an atomic security snapshot.
The kernel's process ABI defines rights and mitigation bits. The PSB reference explains their meaning. Do not infer an exact grant from a token or protection label alone; the target object and requested operation also matter.
Read a refusal accurately #
PSB inspection needs limited query rights and does not require PIP dominance.
Detailed inspection and process-control operations have stronger checks.
Impersonation changes identity without changing the caller's PIP, and
SeDebugPrivilege does not bypass that protection.
A self-targeted PSB read is supported, but that does not mean every operation on one's own process succeeds. Reading the SACL still has its own authority requirement. Missing fields and access errors are not empty permissions.
Changes over time #
PIP follows the executable at exec, so it can change while PID and Process GUID stay the same. Mitigations only become stricter and persist across exec. A thread can install or revert impersonation, and token adjustments or process-descriptor edits can change other inspection results.
Adding --mitigations MASK requests a permanent hardening change. It is not
an inspection option or a way to gain control rights. Read logonse(1) and
the mitigation reference before using it; failure to activate a requested
protection must not be reported as success.
Well-Known SIDs
Peios / Using Peios / Identity and Access
Well-known security identifiers (SIDs) name identities that every Peios system shares, such as Everyone or the Administrators group. They appear in tokens and in permissions on every machine with the same value. This page lists the ones you meet most often. The well-known SID catalog in the Peios Common Data Structures specification is the complete list.
Accounts and groups #
These SIDs identify built-in accounts and groups:
| SID | Name | Identifies |
|---|---|---|
S-1-5-18 | Local System (SYSTEM) | The operating system itself, with the highest level of trust |
S-1-5-19 | Local Service | A built-in account for services that need little authority |
S-1-5-20 | Network Service | A built-in account for services that authenticate to other machines |
S-1-5-32-544 | Administrators | The built-in administrators group |
S-1-5-32-545 | Users | The built-in group of ordinary accounts |
S-1-5-32-546 | Guests | The built-in guests group |
S-1-5-32-551 | Backup Operators | The built-in group for backup and restore |
S-1-5-7 | Anonymous | A caller whose identity isn't known |
Broad groups #
These SIDs match many principals at once:
| SID | Name | Matches |
|---|---|---|
S-1-1-0 | Everyone | Every principal, including Anonymous |
S-1-5-11 | Authenticated Users | Every principal that has authenticated, which excludes Anonymous |
S-1-5-4 | Interactive | Principals that signed in interactively |
S-1-5-14 | Remote Interactive | Principals that signed in from another computer; they also carry Interactive |
S-1-5-2 | Network | Principals that authenticated over the network |
S-1-5-3 | Batch | Principals running a scheduled job |
S-1-5-6 | Service | Principals running as a service |
Placeholders and patterns #
These SIDs stand in for another identity or follow a pattern:
| SID | Name | Meaning |
|---|---|---|
S-1-3-0 | Creator Owner | In an inherited permission, replaced by the new object's owner |
S-1-3-4 | Owner Rights | Replaces the rights an object's owner has automatically |
S-1-5-5-X-Y | Logon SID | One logon session; see Logon Sessions |
S-1-5-80-... | Service SID | One service, written by name as SERVICE\<service-name> |
S-1-16-n | Integrity label | An integrity level; see Integrity Levels |
S-1-0-0 | Nobody | No principal |
Object Security Policy
Peios / Using Peios / Permissions
A security descriptor carries an owner, primary group, DACL, and SACL. The object manager supplies the object type and rights mapping; the caller supplies the subject token and request. The descriptor contains neither the object's data nor a live pointer to its parent's permissions.
Read the whole applicable decision #
The DACL's ordered ACEs contribute discretionary grants and denials. The walk decides each right at its first applicable entry; a later deny does not retroactively reverse an earlier allow. Builders should use canonical explicit-before-inherited and deny-before-allow ordering rather than relying on a later sort to repair intent.
An absent DACL has no discretionary restriction; a present, zero-entry DACL contributes no grants. Neither result bypasses the rest of the pipeline. An empty DACL can still coexist with owner or privilege contributions. Do not describe either state as an unconditional whole-system verdict.
The owner normally receives descriptor-read and DACL-edit rights, not automatic file-data access. An applicable Owner Rights ACE suppresses that implicit grant through a pre-scan, even when its conditional expression would not later grant access. Mandatory policy and later narrowing still matter. Ownership change alone neither removes stale ACEs nor establishes a safe recovery route.
PCDS owns the structure;
the kernel DACL reference
owns evaluation, matching, and maximum-access behavior. A successful
MAXIMUM_ALLOWED check still requires inspecting the returned rights mask.
Inherit at creation #
A creator can supply explicit policy, and a parent can contribute inheritable entries. The token's default DACL is a fallback when explicit and inherited sources supply none; it is not always combined with inherited entries. A protected ACL prevents accepting parent entries into that ACL.
Creator Owner and Creator Group placeholders resolve for each created child. A container can receive an effective resolved entry plus an inherit-only unresolved entry for later descendants. Generic rights can require the same two-part treatment. This keeps one creator's concrete SID from becoming the owner policy for every future descendant.
Inheritance does not recompute during access, retroactively update children, or automatically reapply after moving an existing object. An explicit propagation operation is different from changing a parent's descriptor. Copying creates a new object and has its own preservation options. See PCDS inheritance and the SDK inheritance interface.
Conditions and resource attributes #
User, device, resource, and local claims come from different authorities.
A resource claim resides in the object's SACL, not in its contents or the
caller's token. Attribute names can contain dots without becoming nested
objects: @Resource.Project.Code names the attribute Project.Code.
Coordinate names and types with the policy owner.
Conditions use three-valued logic. For a deny condition equivalent to
Classification == "TopSecret" && not-cleared, a missing classification
makes the comparison UNKNOWN. UNKNOWN AND TRUE remains UNKNOWN, so the deny
applies to an uncleared subject. UNKNOWN AND FALSE is FALSE, so the same
condition does not deny a cleared subject. Missing data does not make every
expression UNKNOWN; evaluate the complete expression.
An UNKNOWN allow does not grant. An UNKNOWN deny applies according to the conditional-ACE rule. Review missing and mistyped attributes explicitly, rather than assuming that any absent claim denies everyone or grants nobody through other entries. The conditional-ACE specification defines the operators and truth tables.
The SACL has several jobs #
Audit and continuous-audit ACEs, integrity labels, process-trust labels,
central-policy references, and resource attributes share the SACL. Its name
does not mean every entry produces an audit record. Access rights for reading
or replacing the SACL differ from WRITE_DAC; owner status alone is not
sufficient.
The label-only security-information interface affects the mandatory label
subset. It does not read or replace audit and central-policy entries. Full
SACL replacement and label-only update are different operations with their
own checks; do not infer their authority from a partial sd show display.
Mandatory resource attributes have additional TCB protection against changes
or removal. Use the descriptor-management
reference for exact gates.
Preserve an authorized repair route #
Before changing policy, establish who can restore the intended descriptor and what backup actually preserves. A text dump from a partial query cannot reconstruct omitted SACL state. Neither ownership-taking nor a saved string guarantees rollback. Verify actual application access with fresh handles after a change and use access diagnosis when the result differs from intent.
The Permissions Editor
Peios / Using Peios / Permissions
The permissions editor is a shared dialog for security descriptors. A caller identifies the object, supplies the readable descriptor parts and named rights, and applies changes returned by the dialog. The dialog does not gain authority over the object or write its descriptor directly.
Views of one descriptor #
Access & Auditing presents identities, grants, denies, conditions, specific rights, and audit rules. Other views cover resource claims, central access policies, and effective access. Owner, group, integrity, and process trust are available through the owner controls.
Advanced Mode shows the ordered access-list entries, control flags, and text representation. Entries the simpler views cannot edit remain preserved. An unchanged entry is returned with its original bytes. Unsupported text-form entries are represented by retention comments; removing such a comment removes that entry.
The caller's declared capabilities restrict what can be changed. An otherwise valid owner also has to satisfy the kernel's ownership rules. A read-only dialog reports why it cannot apply changes.
Inheritance and existing objects #
Changing a container's inheritable rules governs new children. When the caller supports propagation, the dialog asks whether to update existing children too. The caller performs that operation, reports progress, and handles a stop request. Read the final report of failures; partial propagation is not a completed update of every child.
Claim suggestions #
The dialog suggests claims declared in the machine's Security Descriptor Builder catalog, then claims and values recorded by permitted callers when rules were applied. Suggestions help spelling; they do not create a claim on the caller's token or make a condition true.
See gxwi-sd-editor(1) and the registry manual for
Machine\Common\SecurityDescriptorBuilder. Shared descriptor semantics
and the dialog protocol remain owned by the Peios specifications.
Inspecting and Editing File Security
Peios / Using Peios / Permissions
sd reads and edits security descriptors on files. A descriptor identifies an
owner and holds access, audit, and integrity information. Inspect the relevant
components before deciding which change addresses an access problem.
A displayed descriptor is a selected view #
sd show requests the owner, group, discretionary access control list (DACL),
and mandatory integrity-label view. It does not request the full system access
control list (SACL), which also contains audit rules.
Formatting switches do not widen that selection. The --all spelling does not
turn the query into a full export. Human and ordinary JSON summaries also omit
some access-control entry payload details.
Do not use sd show --sddl as a complete descriptor backup. It formats the
queried subset in security-descriptor definition language (SDDL). Matching two
summaries does not establish complete descriptor equality.
Changes depend on the component #
An allow or deny operation appends or replaces selected rules. Removing a principal's rules removes both grants and denials for that principal, so it can broaden access as well as narrow it. Rule order matters when rights are decided.
An access-check simulation helps explain a possible decision without performing the requested operation. It cannot reserve the object's state or guarantee the outcome of a later open.
Ownership, audit rules, and integrity are distinct components with their own access requirements. A change to one does not automatically supply the authority needed to change another.
Inheritance is stored state #
Permitting inheritance lets a descriptor receive inheritable parent rules. It does not create a live link that automatically updates existing children whenever the parent changes. Propagation explicitly refreshes descendants.
Protected descendants retain their own rules. A propagation walk can report individual failures and continue, so inspect the summary rather than assuming the whole tree changed.
Recursive operations treat symbolic links as objects rather than descending through them. A nonrecursive path normally follows the final link unless the physical-link option is selected.
sd(1) owns principal syntax, permission names, component-selection rules,
and the exact subcommand interfaces.
Make and verify a bounded change #
Resolve the intended path and decide whether the final symlink or its target is the object to change. Inspect the selected descriptor components and the parent's inheritance before editing. State whether the goal concerns ownership, ordinary access, audit policy, or integrity; avoid replacing unrelated parts.
Choose the smallest supported operation, then read back the affected components and retry the original operation through a fresh handle. A recursive update can partially succeed. Preserve individual failures, and do not treat a matching summary as full descriptor equality or as proof of application-level success.
Use the descriptor API instead of manipulating the sealed xattr directly.
Linux mode bits and chmod do not express the complete Peios policy. Missing
and corrupt descriptors need the kernel's documented repair contract; granting
a broad synthesis template is not a generic repair.
Executable Marks and Access
Peios / Using Peios / Permissions
mkexec marks a regular file as executable. The mark identifies intended
executable content; it is separate from the security descriptor that
authorizes a process to execute that content.
Two different questions #
A file can have an executable mark while its descriptor denies execution to a particular token. Conversely, an access rule does not identify random data as an intended program. Keep the content decision and the access decision separate.
The mark does not grant privileges, change the user's identity, or create a trusted signature. Inspect a downloaded program and its provenance before making it eligible to execute.
Select the actual file #
mkexec accepts regular files and operates on their executable metadata. It
is not a recursive permission editor. Use sd when the intended change is who
can access the file, and use the packaging workflow when executable metadata
should be reproducible across installations.
mkexec(1) describes accepted operands and errors.
Editing Object Permissions
Peios / Using Peios / Permissions
Open the permissions dialog from the application responsible for the object. That application names its rights and applies the resulting descriptor using the access it already holds.
Before you start #
You need access to read the relevant descriptor parts and to change the parts you intend to edit. Record the existing owner and rules when you need a recovery path. Application-specific rights are meaningful only in that object's context.
Review and apply #
- Open Permissions for the intended file, registry key, service, or policy object. Check the object name and type in the dialog.
- Inspect the owner and existing rules. Use Advanced Mode when order, conditions, or entries outside the simple view matter.
- Make the intended change and select Apply or OK.
- If asked about existing children, choose propagation only for the intended scope and review its progress and failures.
Check the result #
Read the caller's apply response. Reopen or refresh the descriptor to inspect what was stored, then test the intended operation with the relevant account. Existing open handles can retain rights granted before the descriptor changed.
An effective-access view explains a calculation from the information it has; it is not a substitute for the consuming component's full operation and runtime policy. Do not remove an unfamiliar advanced entry merely because another view cannot display it.
Changing Default Security Descriptors
Peios / Using Peios / Permissions
A component can accept a security descriptor to apply when creating or preparing an object. Such a setting is policy for that component; it is not a registry feature that rewrites objects automatically.
Before you start #
Find a documented override for the object in the component's registry manual.
The proposed Machine\Software\<Software>\SdDefaults convention is not
implemented universally. Creating a plausible key does nothing unless the
component reads it. In particular, Peinit's static device-node policy uses
compiled descriptors; a planned override name in its source is not an active
setting.
Read when the component applies the descriptor and how it handles absent or invalid input. Do not assume every descriptor setting has the same fallback: rejection, retaining a prior value, and using a compiled default are distinct policies.
Change and verify the default #
- Record the existing override, including whether it is absent, and the actual descriptor on the affected object.
- Prepare the component's documented recovery path. Preserve the previous descriptor separately if permission changes need to be undone.
- Change only the supported setting, with its documented type and layer.
- Use the component's normal creation or preparation workflow. Do not delete a live state file merely to force it to be recreated.
- Inspect the resulting object's descriptor and component diagnostics. Test the intended reader and writer identities, not only an administrator.
Valid descriptor syntax does not establish that its grants are appropriate. A fallback after invalid input can also differ from the intended policy.
What does not follow from an override #
Changing the stored default does not automatically update existing objects or descendants that already inherited permissions. Removing the registry layer cannot undo descriptors stamped while that layer's value was effective.
The registry key's own permissions govern who can edit the configuration. A descriptor stored as a value governs the different object whose creator reads it. Review both boundaries; changing Permissions… on the key is not the same operation as editing the stored descriptor.
Bootstrap descriptors, kernel mount-policy templates, and package payload
permissions have their own owners and application points. A token's
DefaultDacl is another mechanism, supplied by authentication
policy.
Do not substitute one mechanism for another without the consumer's explicit
support.
Capability Policy
Peios / Using Peios / Application Boundaries
A capability SID names an audience for access policy. Its effect depends on
where the token carries it, not on its name. A capability called
internetClient does not itself intercept network traffic or grant a socket.
An enforcing object manager and matching resource policy must exist.
Grants and confinement #
| Token field | Effect of a capability SID |
|---|---|
| Ordinary groups | Participates in the normal DACL walk, subject to group attributes. |
| Confinement capabilities | Participates in the additional confinement intersection when that pass is active. Presence matters; disabling a capability does not remove it from that identity. |
| Both | Can satisfy both walks, but does not bypass any other access restriction. |
Using capability SIDs in ordinary groups is sometimes called positive confinement. It is an administrative convention for grants, not a sandbox. It does not remove unrelated rights, privileges, or existing handles.
For example, a media library can grant read access to a media-library-read
SID. An administrator can arrange for approved service tokens to carry that
SID as an enabled group, without listing every service account in every
file's DACL. A service given that SID only in its confinement capabilities
still needs its ordinary identity to obtain the read grant. An intersection
cannot create rights missing from the first walk.
Keep the account, token-creation policy, and object grants distinct. Changing a policy document does not update an already-created token. Verify the launcher's actual token construction rather than assuming an application manifest is automatically interpreted by authd.
Confinement as a second check #
An active confinement pass intersects the existing grant with the rights justified by the confinement SID and capability list. Backup and restore privilege grants do not escape that intersection. Owner implicit rights are not added by the confinement walk. A null DACL still means no discretionary restriction, so confinement is not an unconditional deny-by-default wrapper around every object.
A library file can therefore grant ordinary read access to the service's account and confinement read access to its package SID. The service can read it but cannot change its DACL merely because the account owns it. Granting a capability alone cannot overcome MIC, PIP, central policy, or a denial in the ordinary walk.
Normal confinement includes ALL_APPLICATION_PACKAGES; strict confinement
omits it and consequently does not match broad grants to that SID. These
are supplied SID sets, not a separate mode flag. Supply every intended
capability explicitly. The kernel confinement
reference
defines virtual groups, conditional expressions, null DACLs, and ordering.
Confinement constrains AccessCheck-mediated operations. It does not remove standalone kernel privileges, isolate namespaces, make inaccessible objects invisible, or retroactively revoke transferred file handles. Treat the reserved isolation-boundary field as unavailable functionality.
Naming and deploying capabilities #
The capability namespace is S-1-15-3-*. Well-known names include network,
enterprise authentication, certificate-store, and removable-storage
capabilities. Custom names use the defined SHA-256 derivation: eight
little-endian 32-bit subauthorities after S-1-15-3. Use the same exact name
and derivation on the token and resource sides. The
package specification
owns the encoding; a recognizable name is not evidence of enforcement.
Before deploying a capability-based service:
- Identify each resource and required operation, including startup, maintenance, and recovery paths.
- Inspect ordinary groups, privileges, confinement identity, and inherited descriptors independently. A confinement exemption skips that pass.
- Arrange explicit grants on the resources and explicit token creation by the launcher. Keep a separate authorized management path.
- Test both permitted and refused operations with fresh handles. Test failures without granting broad fallback access.
- Recheck a replacement process after policy changes. Record the policy and deployed identities so the result can be reproduced.
Restricted tokens offer a different way to narrow authority inside a program. They can coexist with confinement, but their privilege-restoration rules are different. See restricted tokens.
Process Trust
Peios / Using Peios / Application Boundaries
A process has an identity token, a security descriptor, and a Process Security Block (PSB). They answer different questions:
- The token identifies the caller and its authority.
- The target process descriptor controls which operations that caller can request.
- PIP fields in the PSB describe executable trust. Mitigation fields describe committed process protections.
Impersonation changes the effective token, not the process's PIP tier. An administrator identity does not turn an unsigned debugger into a trusted process, and a trusted service does not acquire every client's authority merely by receiving a request.
Interpreting a refused process operation #
For protected process boundaries, the caller needs the required descriptor
right and sufficient PIP dominance. Dominance compares both type and trust;
it does not replace the operation-specific descriptor check.
SeDebugPrivilege can rescue the descriptor check, but cannot rescue failed
dominance. Kernel-mediated service control through Peinit is distinct from
directly signaling the service from a shell.
Inspect the target's PSB separately from its token and descriptor. PSB queries have a documented limited-query exception to dominance; that does not imply permission to trace, signal, or open the target's token. A visible PID also does not imply access to its metadata. The kernel reference owns operation mappings, self-operation exceptions, partial multi-target signal success, and the limits of PIP.
PIP is enforced by a trusted kernel. It does not defend against a compromised kernel, unrestricted DMA, or a hostile hypervisor. Protected-process core dumps are disabled in the maintained implementation; do not assume a high-trust crash collector is installed.
Signing and running a binary #
A valid executable signature establishes a tier only if the running kernel trusts its public key. The maintained validator accepts Protected/PeiosTcb entries; adding entries for hypothetical tiers requires an implementation change. A listed key does not prove the complete table passes validation.
Ordinary unsigned binaries can run without a PIP tier. That is different from failure of the verification machinery, which can refuse execution, and from kernel-initiated helpers, which require TCB trust. Executing under a tracer or supervisor can cap a would-be trust increase. Read back the running process's state instead of inferring its tier from a package or filename.
For a script, the final interpreter determines the execution tier. A symlink resolves to the target file. Verified content can be pinned against in-place mutation; pinning is not released merely because the process exits. A failed exec can leave content pinned. Use the deployment's replacement-file workflow for updates rather than assuming signed files remain editable in place.
The verification reference and exec lifecycle define these rules. The signature specification owns the wire format and hashing rules. Detached package signatures are a transport convention, not another kernel runtime lookup path.
Build and release trust #
Keep private signing keys in controlled signing infrastructure. Runtime verification needs public keys and signatures, not private keys. Record the kernel's trusted public-key fingerprints and the signing provenance of the artifacts deployed with it. A development or KUnit key is not release trust.
Package authenticity, executable PIP signatures, module signatures, and firmware verification serve different purposes. Successfully producing a Bazel package does not establish that every required signing step or image composition step occurred. The retired Pekit image recipe is not a supported replacement for the deferred Peios package (PPK) image composer.
The kernel has no runtime signing-key replacement or per-binary revocation service. Key compromise requires a coordinated kernel/key and artifact replacement plan; removing a file alone does not revoke copies elsewhere. Do not promise additional signing tiers or a third-party signing service until their verification and operational support exists.
Boot Authority
Peios / Using Peios / Application Boundaries
The kernel must establish an initial identity before an identity service can run. It constructs SYSTEM and Anonymous bootstrap tokens directly. SYSTEM provides the initial authority; Anonymous represents a minimal identity for anonymous impersonation. They are not accounts loaded from a user database. Their exact fields and lifetime belong to the kernel bootstrap reference.
Prelude runs as PID 1 in the initramfs. It prepares kernel filesystems and runs image-supplied hooks that make the real root available. When it hands off, the same process number executes the real-root init, normally Peinit. The programs perform different jobs; a successful handoff does not establish that every later service or security policy is ready.
Peinit prepares the system's foundational state, starts the registry, then loads and supervises the service graph. SYSTEM platform tokens and authd-issued service identities use separate launch paths. The child receives its intended token before its service executable runs. User sign-in is an authd conversation followed by the requesting session launcher's work, not a universal Peinit sign-in procedure.
Distinct trust decisions #
An initramfs archive is a build artifact, not intrinsically authenticated or immutable runtime memory. Its contents become privileged boot code. Record which image, kernel, hooks, drivers, and signatures are deployed; a successful archive build does not prove firmware Secure Boot enforcement.
The token inherited through early boot gives authority. Executable signing establishes PIP at exec. A SYSTEM identity alone does not prove TCB signing, and signing alone does not give SYSTEM identity. Service management requires both the relevant authority and sufficient process trust.
Policy caches, mount policies, descriptors, and process mitigations are separate responsibilities. Neither authd readiness nor reaching the service graph proves that a CAAP or TLP loader populated kernel policy. The maintained Peinit path does not install those global policies or add a per-service mitigation mask.
Follow a boot failure to its owner #
- Before real-root handoff, use Prelude's boot diagnosis.
- For service dependencies, readiness, and recovery, use Peinit boot modes.
- For identity-source readiness and sign-in failures, use the accounts and sign-in guides. Transport availability does not prove every source loaded.
- For executable trust, check the kernel verifier and the running process's PSB. Inspect replacement processes separately after a restart.
A privileged recovery shell belongs to the failed stage and its deployment policy. Do not assume every critical service failure opens a sign-in shell or that exiting a failure shell resumes the failed operation.
The Trust Store
Peios / Using Peios / Certificate Trust
trustd supplies the machine's trusted certificate authorities. It combines shipped roots with registry decisions, then publishes the effective set through a local service and compatibility files.
A program with its own private trust store uses separate policy. Changing the machine store does not establish that every application changed its trust decisions.
Seeing what is in force #
trust status reports health, generation, root counts, and compatibility
output. trust list reports the effective roots served by trustd.
The generation identifies the published set. Programs holding a snapshot
can use it to detect a change. Health is degraded when reading,
composition, or compatibility output fails. It is not safe to infer successful
publication from the registry alone.
trust list --distrusted reads durable registry decisions. It does not prove
that the daemon has applied them. See
Adding and Distrusting Certificates
for changes and verification.
Who can change it {#who-may-change-it} #
The security descriptors on Machine\System\Trust\Certificates and its
subkeys control registry writes. SYSTEM and Administrators have write access
under the default policy; everyone can read. The trust command and library
use the caller's authority. They do not grant permission to change trust.
Reloading trustd has a separate control permission. A caller can have permission to record a decision without permission to request a reload. The daemon also watches for registry changes.
Where trust policy comes from #
| Input | Location | Updated by |
|---|---|---|
| Shipped roots | /usr/share/ca-certificates/mozilla.crt | Root-store package updates |
| Additions and distrusts | Machine\System\Trust\Certificates | Registry policy |
The package supplies certificates; the registry records decisions about them. A distrust can exclude a shipped root without modifying the package. An addition supplies a certificate that the shipped set does not contain.
A root's fingerprint identifies the certificate. Subject names alone do not distinguish certificates reliably. Purpose metadata records the uses for which an addition is trusted.
What programs actually read #
Native clients use libtrust.so to query or subscribe to
/run/trustd/trust.sock. A subscription publishes complete generations.
Applications must replace their own cached trust state when appropriate;
a notification does not itself invalidate an application's existing sessions.
Compatibility consumers read generated bundles or a hashed directory under
/etc/ssl. Those outputs contain roots permitted for ServerAuth.
They are derived from policy, so editing them does not make a lasting change.
See The Compatibility Trust Files.
Installing a root bundle alone does not compose or render the machine store. Likewise, stopping trustd does not remove an existing rendered bundle or invalidate a program's cached copy.
Failure and recovery #
If a complete configuration read or composition fails, trustd retains its
previous effective set and reports degraded health. Missing optional values
retain their documented defaults. An incomplete addition without a
Certificate value is skipped while it is being created.
Compatibility rendering happens after the effective socket set changes. A rendering failure can leave different consumers using different sets. Inspect the failure and verify both the service and the paths used by the affected application. See When the Store Is Degraded.
Adding and Distrusting Certificates
Peios / Using Peios / Certificate Trust
Add a certificate authority when the machine needs to trust an authority outside the shipped set. Distrust a certificate to exclude it even if a package or local addition supplies it.
Before you start #
- Install and start trustd and the
trustcommand. - Obtain write access to the relevant keys under
Machine\System\Trust\Certificates. - Verify the intended certificate's fingerprint through a trusted channel.
- Identify the applications affected by the change and how they obtain trust.
trust(1) owns command syntax. The regman entry for
Machine\System\Trust\Certificates owns the registry schema.
In Security Policy #
Use Security Policy's certificate views to inspect effective roots, additions,
and distrust decisions. Graphical changes use the same registry permissions
as trust. Verify the resulting store and affected applications after using
either interface.
Trusting a certificate authority #
-
Inspect
trust statusandtrust listbefore making a change. -
Obtain the intended certificate as a single PEM or DER file. The following example assumes it is saved as
corp-root.pemin the current directory: -
Follow Verify the Change.
The name identifies the local addition. The command rejects an invalid, expired, or non-authority certificate before writing it. trustd validates certificates again when composing the store.
To withdraw this named addition:
Removing an addition does not create a distrust decision. Another source can still supply the same certificate.
Purposes #
An addition defaults to ServerAuth, used to validate TLS servers. Choose
other purposes only when intended. For example:
Socket queries can filter by purpose. Compatibility bundles and hashed
files include only roots carrying ServerAuth. Applications using other
purposes must request and enforce the appropriate policy themselves.
Distrusting a certificate authority #
- Find the intended certificate with
trust listand inspect it withtrust show. Compare the full SHA-256 fingerprint, not only its subject. - Run
trust distrustwith that fingerprint or its unambiguous prefix. Use--reasonto record why it is being excluded; seetrust(1). - Check the durable decision with
trust list --distrusted, then verify the effective result below.
A complete fingerprint can record a distrust before the machine has that certificate. A later bundle or addition cannot make it trusted while the distrust remains.
To remove a distrust, use trust restore with its fingerprint. Removing
the decision does not supply a certificate that is absent from both the
shipped bundle and local additions.
Verify the change #
- Run
trust status. Resolve degraded health using the procedure below. - Run
trust list. For an addition, inspect its complete fingerprint, source, and purposes withtrust show. - For a distrust, confirm that the root is absent from the effective set
and that
trust list --distrustedcontains the decision. - Retest the affected application. If it caches trust, refresh that state using the application's documented procedure.
A registry write records intent. A socket query confirms the daemon's set. Neither proves that a running application has discarded a cached root or that compatibility rendering succeeded.
Doing it from the registry #
The trust command uses ordinary registry operations. A domain policy can
write the same keys; it does not need a separate trust mechanism.
When creating an addition manually, write Certificate last. trustd skips
an entry without that value so that the other metadata can be prepared
first. Use the regman schema rather than inferring value types from examples.
Package-provided trust {#packages-may-offer-trust-never-take-it} #
Package-provided trust decisions belong in inert registry seeds. Installing files must not silently widen machine trust. Applying a seed is an explicit image or administrative policy action.
A private application store is separate from the machine store. Its contents and refresh behavior belong to that application's documentation.
When the store is degraded #
-
Read the error from
trust statusand preserve the failing operation or path for diagnosis. -
Correct the cause. Repair a missing or invalid root bundle through its package. Correct an unreadable registry configuration or unintended distrust decision without restoring an intentionally excluded root.
-
If rendering failed, inspect the paths the affected application uses. Reported rendered paths can describe an earlier successful render; they are not a fresh inventory after failure. Do not edit generated files.
-
With trustd's control permission, run:
-
Confirm healthy status, verify the intended change, and retest the application.
An authorized reload returns an error if refresh leaves degraded health.
The registry decision remains recorded. Service-manager reload uses SIGHUP;
its completion does not report the result of recomposition, so inspect
trust status afterward.
Skipped invalid certificates are reported separately from degraded health. Read the warnings and correct the named entries before relying on them.
Managing Certificate Trust in Security Policy
Peios / Using Peios / Certificate Trust
Security Policy manages the certificate authorities the machine accepts and its explicit distrust entries. A trust change affects programs that consume that machine policy, so inspect the certificate and its source before accepting it.
Before you start #
You need permission to change Machine\System\Trust. Reloading trustd
uses its separate control permission. Obtain the certificate or fingerprint
through the verification process appropriate to the authority you trust.
Inspect and change trust #
- Open Security Policy and select Trusted or Distrusted.
- Inspect the issuer, validity, fingerprint, and trust purpose. To add a certificate, use Add Certificate and select its PEM or DER file.
- Review the parsed certificate. The application rejects a non-authority certificate, an expired certificate, and conflicting existing trust or distrust entries.
- Confirm only the intended trust, distrust, or removal operation. Read the result.
Check the result #
Verify the certificate in the effective list read from trustd. The window follows changes made through other tools too. A stored entry alone does not establish that every consuming program has refreshed its state.
Settings shows trustd's status, its reload operation, certificate-file
export settings, and permissions. Signing Keys displays code-signing
keys compiled into the kernel; this window cannot add or remove those
keys. See gxwi-security-policy(1) and trust(1).
Understanding Trust Status
Peios / Using Peios / Certificate Trust
trust reads the effective store from trustd and records policy changes in
the registry. These are different views: a stored decision can exist before
the daemon or an application has applied it. trust(1) owns the command
reference, including arguments and exit statuses.
Listing #
trust list shows the effective roots. trust list --distrusted reads
durable
registry decisions. Compare both when checking a withdrawal.
trust list --purpose ServerAuth filters the service response by purpose.
It does not inspect rendered files. Healthy compatibility output uses the
same purpose filter, but a failed render can leave older files in place.
Showing one root #
trust show accepts a full fingerprint or unambiguous prefix from the
listing. An ambiguous prefix is refused. Inspect the full fingerprint,
source, and purposes before making a trust decision.
The --pem option emits only the certificate, suitable for export.
Exporting it does not change policy.
Exit statuses #
A command finding no matching root differs from a failed attempt to query
trustd. Scripts should check the exit status described in trust(1) rather
than treating every empty result as absence.
A successful registry write means the decision was recorded. Verify healthy
status and the effective store before treating it as applied. trust reload
returns failure when the refresh leaves degraded health.
When a write is refused #
trust has no additional authority to grant. Registry descriptors govern
changes, and trustd's control descriptor separately governs reload requests.
Have an authorized administrator perform the intended operation.
Editing generated certificate files is not a substitute for changing policy. The next render replaces them, and other consumers can use the service instead of those files.
Reloading through the service manager #
svctl --wait reload trustd sends SIGHUP. trustd processes it in its event
loop without replacing the main process. Repeated pending signals can be
combined into one refresh.
Inspect trust status afterward. Delivery of a service reload does not prove
that reading configuration, composing roots, or rendering files succeeded.
The Compatibility Trust Files
Peios / Using Peios / Certificate Trust
trustd renders certificate files for programs that obtain machine trust from
a path. The files are derived output, not configuration. Change trust through
the registry or trust; manual edits are replaced on the next render.
Three artifacts, because the ecosystem does not agree #
| Path | Purpose |
|---|---|
/etc/ssl/certs/ca-certificates.crt | Certificate bundle |
/etc/ssl/cert.pem | Alternate bundle path |
/etc/ssl/certs/<subject-hash>.0 | Hashed certificate lookup |
Roots with the same subject hash use successive numeric suffixes. Updating only a bundle would leave hashed lookups using stale roots, so trustd rebuilds the certificate directory as well.
Only roots with ServerAuth are rendered. Purpose metadata is not embedded
as a substitute for application validation; each consumer still applies its
certificate rules.
Publication and failure #
The renderer prepares a replacement certificate directory and attempts an atomic exchange. Where exchange is unavailable, it uses renames with rollback. The fallback can temporarily leave the directory absent. A rollback failure can require repair.
The directory and alternate bundle are separate operations, and the service publishes its effective set before rendering. No single atomic switch covers the socket and every file. A failure can therefore leave consumers observing different generations.
Follow degraded-store recovery and check the actual paths used by the application. A previously reported rendered path is not proof of its contents after a failed refresh.
Turning them off #
Machine\System\Trust GenerateLinuxTrustFiles selects whether trustd supplies
compatibility files. Its regman entry owns the value reference.
Turning file output off removes trust inputs from programs that require those paths. Use that mode only when the installed applications use the service or deliberately managed private stores. The socket continues serving.
Removal itself uses several filesystem operations and can fail partway. A stored setting does not prove that all files were removed. Check service health, the relevant paths, and application behavior after changing the mode.
To restore ordinary file output:
These operations require registry write access and trustd's control right. Confirm healthy status and retest the application.
Why a copy, when name resolution gets a pointer #
A resolver configuration can name a service that answers later requests. A certificate bundle has to contain the authorities itself. It cannot direct a consumer to ask trustd instead, which is why file consumers need a rendered copy and their own refresh behavior.
The effective roots are public, so generated files are readable by ordinary programs. Changing the policy remains protected by registry permissions.
The Certificate Authority
Peios / Using Peios / Certificate Authority
A Peios machine can run its own certificate authority: pkid, a service that issues X.509 certificates for the machines, services, and people on your network, such as a server's TLS certificate or the certificate a phone signs in to Wi-Fi with. If you have run an enterprise certificate authority, the pieces will be familiar: CAs, templates that describe each kind of certificate, and requests that are issued at once or held for an officer.
You manage pkid with the pki command, or with the Certificate Authority
window: open Certificate Authority from the launcher, or run
pki --window. pkid decides every request by the access token of whoever
sent it, so pki and the window can do exactly what you can, and nothing
more. The window asks pkid and the Registry what you may change, offers
only that, and shows the rest read-only with the reason. Someone who may
only request certificates sees the authorities they can request from and
their own requests and certificates.
How a certificate is issued #
A certificate starts as a request: a public key and the names it is for, signed with the matching private key to prove the requester holds it. The request names a CA and a template, and pkid checks it in this order:
- The CA. The requester needs the Request right in the CA's security descriptor.
- The template. The requester needs the Enroll right in the template's descriptor, and the request has to fit the template: the kinds of key and name it allows.
- Each name. The requester needs the right to request every name in the certificate, from the name trees.
A request that passes is issued at once, or held for an officer of the CA to approve, when the template or a name asks for approval. A request that fails any check is refused, with the reasons. pkid records every request and decision in its database, with who made it.
The template decides everything else about the certificate: its purposes, key usages, and lifetime. A requester can't change any of it, so the template, not the request, is what an administrator reviews.
CAs #
A CA is a key and a certificate that signs other certificates. Most networks have two tiers:
- A root signs its own certificate. Every device that is to trust your certificates adds the root's certificate to its trust store once.
- An issuing CA below the root signs the certificates people and machines use. Its certificate is signed by the root.
Two tiers let you keep the root's key away from the network. pkid keeps a CA's key in one of two places:
- pkid's store, readable by pkid's service account alone. A CA whose key is here issues unattended, as an issuing CA does.
- A sealed file, protected by a passphrase, such as on removable media. pkid never keeps such a key open: every operation that signs with it asks for the passphrase. A root's key belongs here, and the media can stay in a drawer until the root next signs something.
A CA can also be signed by a CA elsewhere, or sign a subordinate CA that runs elsewhere, so pkid can fit below or above an existing hierarchy.
Templates #
A template describes one kind of certificate: what it is for, how long it lasts, which keys and names a request can contain, and whether every request waits for approval. A CA issues only from the templates it is given.
pki setup adds two templates:
- Server, for TLS servers named by host name. Its certificates last 90 days.
- Device, for client authentication, such as EAP-TLS on Wi-Fi, for devices and people named by user principal name or email address. Its certificates last a year.
Both let any authenticated principal enroll. Enrolling grants nothing by itself: the names decide.
Names #
The name trees decide who can request certificates for which names. There
are two trees, one of host names, such as radius.lab.home, and one of
principal names, such as alice@home. Each name can have its own security
descriptor and its own owner, and names below it inherit its descriptor's
inheritable entries, so a grant on lab.home covers every name under it.
Three rights apply to a name:
- Request issues certificates for the name without approval.
- Request with approval holds them for an officer.
- Wildcard also permits the name's wildcard form, such as
*.lab.home.
A name's owner is the principal it belongs to, such as the RADIUS server's
account for radius.lab.home. The roots of both trees grant Request to
PRINCIPAL SELF, which matches a name's owner, so every owner can request its
own names, and Administrators can request any. Nobody else can request
anything until you grant it. A certificate whose names all belong to one
owner carries the owner's SID, so services that accept it for sign-in can
match it to the account rather than to a name that only looks the same.
Rights on a CA #
Each CA's descriptor grants four rights:
- Read shows every request and certificate. Without it, a caller sees only its own.
- Request lets a caller submit requests.
- Officer approves and denies held requests and revokes certificates. An officer can never approve a request it submitted itself.
- Manage changes the CA, signs subordinate CAs, and exports its key.
By default, Authenticated Users can request, and Administrators and SYSTEM
hold every right. pkid(8) describes each right and descriptor.
Who can create and import CAs is a descriptor of its own, which grants
Manage to Administrators and SYSTEM by default. pki ca creators shows and
sets it, as does Who Can Add Authorities on the Certificate Authority
window's overview.
Revocation #
A certificate can be revoked before it expires, such as when its key is exposed. Each CA publishes a certificate revocation list (CRL) of what it has revoked, which pki-httpd serves over HTTP at an address written into every certificate the CA issues, so that software checking a certificate can find out. pkid renews the list of a CA whose key it keeps; an offline root's list is renewed by hand, with its passphrase. Publishing Revocation Lists explains how.
Where it is kept #
The configuration, the templates, names, and CAs, is in the Registry under
Machine\Software\Pki, which regman documents value by value. pkid takes a
change up as soon as it is written, but only as a whole: while any part of
the configuration is invalid, pkid issues nothing and says why in its
pkid.configuration.loaded event. pki checks each change by the same
rules before it writes it.
Requests, certificates, and revocations are in pkid's database. pki(8)
documents every command, and pkid(8) the service.
Setting Up a Certificate Authority
Peios / Using Peios / Certificate Authority
Set up a certificate authority when the machines and people on your network need certificates you issue yourself. When you finish, you have a root CA whose key is kept off the machine and an issuing CA that issues server and device certificates unattended.
Before you start #
- Sign in as a member of Administrators.
- Make sure the
pkipackage is installed. It doesn't start pkid or pki-httpd: they start once you set the machine up. - Have removable media mounted for the root's key, such as
/media/usb. - Choose a passphrase of at least 15 characters for the root's key, and somewhere safe to keep it. Without the passphrase, the root can never sign again.
Prepare the machine #
Run pki setup once:
It creates pkid's state directories under /var/state/pki and adds the
default configuration under Machine\Software\Pki: the Server and Device
templates and the roots of the name trees. Then it has pkid, and pki-httpd,
which publishes revocation lists, start at boot, and starts them. It only
adds what is missing, so running it again changes nothing you have set.
In the Certificate Authority window, the overview offers Set Up to an administrator until the machine is prepared.
Create the root #
-
Create the root, with its key sealed in a file on the removable media:
pkiasks for the key's passphrase twice. pkid makes the key and the root's certificate, an RSA-4096 one that lasts 10 years.--crlis the address where the root's revocation list will be published, and goes into the certificates the root signs; see Publishing Revocation Lists. -
Publish the root's first revocation list while its key is to hand:
-
Write the root's certificate to a file, to give to the devices that are to trust it:
Create the issuing CA #
-
Create the issuing CA, signed by the root, issuing from both templates:
pkiasks for the root key's passphrase, since the root signs the new CA's certificate. The issuing CA's key goes in pkid's store, so it issues without a passphrase, and its certificate lasts 5 years. pkid publishes its revocation lists itself. -
Unmount the removable media and store it safely. The root is needed again to sign another CA, and to renew its revocation list, which lasts 180 days.
Check the result #
List the CAs:
Both CAs are listed, each with the state issuing. pki ca show "Home Issuing" shows the issuing CA in full, including the templates it
issues from and its certificate's SHA-256 fingerprint.
Distribute the root #
Every device that is to trust your certificates needs home-root.pem in its
trust store. Check its SHA-256 fingerprint against pki ca show "Home Root"
when you install it. On a Peios machine, add it as described in
Adding and Distrusting Certificates.
Keep a copy of the issuing CA's key #
A key in pkid's store can't leave it unless the CA was created with
--exportable. To be able to restore the issuing CA on another machine, add
--exportable when you create it, then export its key, sealed under a new
passphrase:
pki ca import restores it from the file and the CA's certificate.
Have a CA elsewhere sign your CA #
If your network already has a CA, make pkid's CA its subordinate instead of
a root. --offline writes a request for that CA to sign:
Once the other CA has signed it, install the certificate it returns:
The CA issues nothing until its certificate is installed.
Use the Certificate Authority window #
Add an Authority in the window's sidebar makes each kind of CA these steps make: a Root Authority, one Under an Authority Here, one Signed by an Authority Elsewhere, or one imported from a backup with Import From a Backup. Its Key Storage is the Certificate Service's store, or a Sealed File with a passphrase. A CA's page has Export Key, Sign a Subordinate Request, and, while it waits for its certificate, Save Request… and Install Certificate…. Only someone with the right to create CAs sees Add an Authority.
Controlling Who Can Request Certificates
Peios / Using Peios / Certificate Authority
Change who can request certificates when the defaults don't fit: a server that is to request its own certificate, a group that is to request names under a domain, or a kind of certificate that needs an officer's approval.
By default, a name's owner can request certificates for it, Administrators can request any name, and nobody else can request anything.
Before you start #
- Sign in as a member of Administrators. The name and template commands
write the Registry under
Machine\Software\Pki, which only Administrators can change. - Run
pki setupfirst, as described in Setting Up a Certificate Authority.
Let a principal request its own name #
Make the principal the name's owner, by its SID:
The roots of the name trees grant Request to PRINCIPAL SELF, which matches a
name's owner, so the owner can now request certificates for
radius.lab.home without approval. Ownership covers exactly that name, not
the names below it, and certificates for the name carry the owner's SID.
Never make a broad group, such as Users, an owner: every member could then
request certificates for the name. pki warns if you do.
Let every account request its own principal name #
Rather than set an owner for each person's principal name, let the accounts on this machine own theirs. List the domains this machine speaks for:
Now alice@home, with no owner of its own, belongs to the account alice:
Alice can request certificates for it, such as for signing in to Wi-Fi, and
they carry her account's SID. Nobody else can request it, as PRINCIPAL SELF
matches only its owner. Only the account's name is used, which only an
administrator can change, and a domain not listed is never looked up, so
list only your own. An owner you set with set-owner still wins.
Let a group request names under a domain #
Give lab.home a descriptor that grants the group Request with approval
(0x2), marked to inherit (CI) so it covers every name below:
Here AU is Authenticated Users. Their requests for names under lab.home
now wait for an officer of the CA. pki adds the entries lab.home
inherits from above, so Administrators and owners keep the rights the root
gave them.
A tree's root, . or @, inherits nothing, so its descriptor replaces the
shipped one whole. pki warns if a new root descriptor leaves Administrators
unable to request the names in the tree, or owners unable to request their
own.
Prefer Request with approval for groups. Request (0x1) issues without
anyone looking, so granting it to a broad group lets every member obtain
certificates for those names; pki warns when you grant it. Wildcard (0x4)
also permits names such as *.lab.home.
To undo the change and let lab.home inherit again:
Hold every certificate of a kind for approval #
Set a template's issuance to approval, and every request under it waits
for an officer, whatever the names allow:
Add a kind of certificate #
Create a template from a copy of another and change what differs, such as a server template whose certificates last 30 days:
pki refuses a template pkid wouldn't load, such as one whose renewal
window isn't shorter than its lifetime. Then let a CA issue from it.
--template replaces the CA's list, so give every template it is to keep:
A template's enrollment descriptor decides who can use it at all;
--enroll-security changes it.
Use the Certificate Authority window #
The window's Templates and Names pages make the same changes. Who Can Request opens the permissions editor on a template's or a name's descriptor; for a name, it shows the entries it inherits from the name above it. A name's page sets its Owner, by account name, and Inherit Again… drops its own permissions. Principal Domains is at the top of Names. Each control appears only where your permissions in the Registry let you change it.
Check the result #
Show a name to see its owner, its descriptor, and where the descriptor comes from:
www.lab.home has no settings of its own, so its descriptor is inherited
from lab.home. pki name list lists the names with settings of their own,
and pki template show Server shows a template and the CAs that issue from
it.
Requesting a Certificate
Peios / Using Peios / Certificate Authority
Request a certificate when a server, a service, or a device needs one from
your CA. You can send a request that other software made, or have pki
make the key and package the result for a device to import.
Before you start #
- Find the CA's name and the template to use.
pki ca listlists the CAs you have rights at, andpki ca showlists the templates a CA issues from. - Make sure you can request the names the certificate is to carry, as described in Controlling Who Can Request Certificates.
Certify a request you made #
Software that keeps its own key, such as a web server, makes the request itself, in PEM or DER. Submit it under a template the CA offers:
If the CA issues the certificate, pki writes it to www.pem. If the
request is held for approval, pki prints its number instead. Once an
officer approves it, collect the certificate:
Make a key and certificate for a device #
Phones, laptops, and other devices import a key and its certificates as one
PKCS #12 file. pki enroll makes the key on this machine, asks the CA to
certify it, and writes the file:
pki asks for a passphrase of at least 15 characters, which protects the
file and is asked for again when it is imported. pkid sees only the request,
never the key. The file holds the key, the certificate, and the CA
certificates above it that you can see on this pkid, so a device that
imports it can present the chain.
Name the certificate with --dns for a host name, --email for an email
address, or --upn for a user principal name, which EAP-TLS sign-in to
Wi-Fi uses. Each can be repeated.
The file is encrypted with AES-256, as OpenSSL 3 writes by default, and OpenSSL 3 imports it. Apple systems older than iOS 18 and macOS 15 are reported to refuse it.
When the request is held #
The key exists nowhere but on this machine, so a held request can't lose
it: pki seals the key under the same passphrase in a file beside the one it
would have written, here alice.p12.key, and prints the command that
finishes the job. Once an officer approves request 42, run:
Delete alice.p12.key once the device has imported the file.
Request a certificate with the Certificate Authority window #
- Open Certificate Authority from the launcher, and choose Request a Certificate in the sidebar.
- Choose the Authority and the Template. Only those you may request from are offered.
- Type the names the certificate is for, separated by commas.
- Leave Key set to Make a Key Here to have the window make the key and save it with its certificates as a PKCS #12 file. Choose Save To and a Password of at least 15 characters. To certify a request other software made, set Key to Use My Own Request and choose the request file instead.
- Choose Request Certificate.
If the request is held for approval, the window keeps the key sealed beside the file and remembers the request. Once an officer approves it, the overview says the certificate is ready: open the request, choose Save…, and type the file's password.
Check the result #
List the CA's certificates:
The new certificate is listed with the state valid, its serial number,
and when it expires. pki cert show with the serial number shows it in
full.
Approving and Revoking Certificates
Peios / Using Peios / Certificate Authority
Approve and revoke certificates when a CA holds requests for an officer, or when a certificate's key is lost or its holder leaves. These are an officer's tasks: they need the Officer right in the CA's descriptor, which Administrators hold by default.
Before you start #
- Sign in as an officer of the CA.
pki ca show "Home Issuing" lists your rights at the CA under Your access.
Make someone an officer #
Officers are named in the CA's descriptor. Someone with Manage CA at the CA can change it. To let the group Lab Officers approve and revoke, while everyone signed in can still request and Administrators keep every right:
In the Certificate Authority window, open the CA's page and choose Edit… under Permissions, which opens the permissions editor with these rights by name.
The descriptor replaces the one the CA had, so include every grant it
should keep. Grant 0x4 (Issue and Manage Certificates) and 0x8 (Manage
CA) only to people you trust to issue any certificate. pki warns you if
the descriptor lets a broad group approve or manage, or leaves you without
Manage CA. pki(8) lists the rights.
Approve or deny held requests #
-
List the requests waiting for an officer:
Each is listed with its number, template, when it was submitted, and the names it asks for.
-
Look at a request in full, including who submitted it and why it was held:
-
Approve it, which issues the certificate:
Or deny it, recording why:
You can't approve a request you submitted yourself; another officer has to. pkid checks an approved request again as its requester, so approving it issues only what the requester was allowed to ask for, whatever the officer's own rights.
The requester then collects the certificate, as described in Requesting a Certificate.
With the Certificate Authority window #
Open Requests. Requests waiting for an officer are listed first, each with Approve and Details. Deny… on a request's page asks for an optional reason. The window shows your own requests without these, with why: another officer has to decide them.
Revoke a certificate #
-
Find the certificate's serial number:
-
Revoke it, with the reason, such as
key-compromisefor a key that was exposed orsupersededfor one that was replaced:
A revocation can't be undone. pkid records it with its reason, the time, and
the officer who made it. pki(8) lists every reason.
In the Certificate Authority window, open the certificate from Certificates and choose Revoke…, then the reason.
Software learns of the revocation from the CA's revocation list. pkid
publishes a new list at once for a CA whose key it keeps. For a CA whose key
is in a sealed file, pki reminds you to publish one with
pki ca publish-crl, as described in
Publishing Revocation Lists.
Check the result #
Show the certificate:
Its state is revoked, with when, why, and by whom. A request you approved
or denied leaves the list that pki request list "Home Issuing" --status pending prints.
Publishing Revocation Lists
Peios / Using Peios / Certificate Authority
Publish revocation lists so that software checking a certificate can find out whether it was revoked. Each CA signs a certificate revocation list (CRL) naming the certificates it has revoked, and pki-httpd serves it over HTTP at the address the CA writes into every certificate it issues.
A revocation has no effect on software that never fetches the list, and software that does fetch it rejects every certificate below a CA whose list has expired. So a CA needs both an address that will keep working and a list that is kept current.
Before you start #
- Sign in as a member of Administrators.
- Choose a host name for the address that will outlive this machine, such as
pki.home, and make it resolve to this machine. The address is written into each certificate when it is issued, so changing it later leaves every certificate already issued pointing at the old one. - Make sure the pkid and pki-httpd services are installed, and run
pki setup, which reserves TCP port 80 for pki-httpd.
Give each CA an address #
-
Give a CA its address when you create it, with
--crl:The root's address goes into the certificates the root signs, so the issuing CA's certificate carries it, and the issuing CA's address goes into the certificates it issues.
-
For a CA that exists already, set its address with
ca set. Only certificates issued afterward carry it:
pki-httpd serves each list at the path of its address, so
http://pki.home/crl/home-issuing.crl is served as /crl/home-issuing.crl.
Use letters, digits, ., -, _, and ~ in each part of the path.
Keep each list current #
A CA whose key pkid keeps, such as the issuing CA, looks after its own list: pkid signs a new one after every revocation and at half each list's lifetime, which is 7 days unless you change it.
A CA whose key is in a sealed file, such as an offline root, can sign only with its passphrase, so you renew its list by hand. Its lists last 180 days.
-
Mount the media holding the root's key.
-
Sign and publish a new list:
pkiasks for the root key's passphrase.
Do this after the root revokes anything, and well before its list expires:
pki ca list flags a list that expires within 30 days, and pkid emits a
pkid.crl.expiring event each day until it is renewed.
To change how long a CA's lists last:
In the Certificate Authority window, a CA's page shows its latest list and when it expires, and Publish Now signs a new one, asking for the key's passphrase if it is sealed. The overview lists each list that is due or has expired.
Check the result #
List the CAs and when their lists expire:
Then fetch a list from another machine, such as with curl, and check it
names the CA:
Serve on another port #
If another service already serves port 80, pki setup warns that the port
is reserved for it. Choose another port for pki-httpd, such as 8080, and
reserve it:
Restart pki-httpd, and give each CA an address with that port, such as
http://pki.home:8080/crl/home-issuing.crl. In the Certificate Authority
window, change Revocation List Port on the overview, which restarts
pki-httpd for you. pki-httpd(8) describes
the service.
How Crypto Policy Works
Peios / Using Peios / Crypto Policy
Peios applies one crypto policy to every program on the machine that uses libpcrypto or libpssl, its libraries with OpenSSL's API. The policy decides which algorithms a program can use, records the use of weak ones, and lets named programs keep using an algorithm that they need and that the policy would otherwise refuse.
The policy is configured under Machine\System\Cryptography. cryptod, the
crypto policy service, publishes it as a file that the libraries read, and
records what programs report of their weak cryptography.
Grades #
Each use of cryptography is graded as an entry: an algorithm and the
operation it's used for, such as md5.hmac for HMAC-MD5 or md5.digest
for an MD5 digest. The same algorithm can have different grades for
different operations. MD5 is broken as a digest, but HMAC-MD5 has no
practical attack.
Grades run from U to A:
| Grade | Meaning |
|---|---|
| U | Practically broken, or forbidden by current standards |
| D | No practical break, but under 112-bit security or deprecated |
| C | 112-bit security |
| B | 128-bit security |
| A | 192-bit security or more |
Separately, each entry records whether FIPS 140-3 approves it. FIPS approval isn't a grade: FIPS approves some entries below A, such as HMAC-SHA-1, and doesn't approve some A-grade ones.
/usr/share/peios-crypto/algorithms.tsv lists every entry, with its grade
and whether FIPS approves it.
A few entries are on the floor: they're refused under every policy, and no exception can allow them. The floor holds ciphers and TLS suites that encrypt nothing, the 40-bit export-grade RC2 cipher, RSA keys and Diffie-Hellman parameters under 1024 bits, and ECDSA signing with a fixed nonce, which gives away the private key.
Thresholds #
The policy has two thresholds:
- Reject: entries below this grade are refused. By default it's U, so only the floor is refused.
- Warn: entries below this grade are allowed, but their use is recorded. By default it's C, so the use of anything graded U or D is recorded.
Each can also apply to every entry FIPS doesn't approve, whatever its grade. Turning that on for Reject doesn't make the machine operate in a FIPS-approved mode, because the libraries' module isn't validated.
A refused call fails as if the algorithm weren't supported. A few
low-level functions can't report failure, such as SHA256 and MD5_Init,
so a program that calls one for a refused entry ends. Before raising the
Reject threshold, find out what would stop working: see
Configuring Crypto Policy.
Exceptions #
An exception lets particular programs use particular entries: a RADIUS
server that must use HMAC-MD5 because the protocol requires it, for
example. Each exception is a key under
Machine\System\Cryptography\Exceptions, named Owner.Purpose, such as
Radius.PacketAuth. It names the entries it allows, and has a security
descriptor, ProgramSecurity, granting the programs that can use it.
Packages add the exceptions their software needs when they install, and remove them when they uninstall.
An exception allows an entry the Reject threshold refuses only while
Exceptions\AllowExceptionsToReject is 1, its default. When it's 0,
exceptions only stop warnings. An exception never allows an entry on the
floor.
When changes apply #
cryptod publishes the policy when it starts, and again a moment after
Machine\System\Cryptography changes. Each process reads the policy once,
at its first use of the libraries, and keeps it for as long as it runs.
So a change applies to processes started after it's published. A service that's already running keeps the policy it started with until it's restarted. Exceptions work the same way, so a service doesn't lose one partway through a request.
cryptod also keeps a copy of the policy that survives a reboot. A process that starts before cryptod reads that copy. A process uses Peios's built-in defaults only on a machine where cryptod has never run, or if it can't use either copy.
What's recorded #
The libraries report to cryptod, and cryptod records each report as an event:
cryptod.algorithm.warned: a process's first use of each entry below the Warn threshold.cryptod.exception.used: a process's first use of each exception, whether or not the exception warns. An audit can always find the weak cryptography in use.cryptod.policy.failed: a policy cryptod couldn't publish as written, or one a process couldn't use.cryptod.policy.applied: each policy cryptod publishes.
Each process reports each use once, so the records show which programs use what without one for every call. A process is named by the identity and process ID the kernel recorded when it connected to cryptod.
cryptod also keeps a summary of what's been used, and by whom, since it started. See the cryptod reference.
When something is wrong #
cryptod checks the policy when it publishes it:
- If a setting such as a threshold can't be read, cryptod keeps the policy
it last published, and records
cryptod.policy.failed. Falling back to defaults could loosen a policy an administrator had tightened. - If an exception can't apply as written, cryptod drops that exception
alone, so it allows nothing, publishes the rest, and records why. A
misspelled entry, such as
md5.hmca, is the usual cause.
A process uses a copy of the policy only if SYSTEM or cryptod owns it and nobody else can change it. Otherwise it uses the next copy, or the defaults, and reports it.
Limits #
- A process that starts before cryptod is listening can't report, so its first uses aren't recorded. It still applies the policy.
- A report is attributed to the identity of the reporting thread when it connected. A thread that was impersonating a user then is recorded as that user. The process ID still identifies the process.
- A process that replaces its primary token keeps the exceptions of the token it started with.
- Policy is applied to programs that use libpcrypto and libpssl. A program with cryptography of its own, or a statically linked copy of another library, is outside it.
Configuring Crypto Policy
Peios / Using Peios / Crypto Policy
Tighten the crypto policy in steps: find what would stop working, give the services that need a weak algorithm an exception, then raise the threshold. Check the result after each change.
The regman entry for Machine\System\Cryptography owns the complete
configuration reference. evman cryptod describes the records cryptod
writes.
Before you start #
- Check that cryptod is running:
svctl status cryptod. - Obtain write access to
Machine\System\Cryptography. SYSTEM and Administrators have it. - Obtain read access to cryptod's events in eventd.
- Allow time for the machine to run its normal workload under the current policy, so that the records show everything it uses.
Find the weak cryptography in use #
-
List the programs that used an entry below the Warn threshold:
Each record names the entry, its grade, and the process that used it.
-
List the uses of a grade that a new threshold would refuse. For example, before refusing everything below C:
-
List the exceptions in use, and by which programs:
Every program in these results would fail to use its entry under the new
threshold, unless it has an exception. A program that calls a low-level
digest function, such as SHA256 or MD5_Init, for a refused entry
ends.
Let a service keep an algorithm #
Give an exception to a service that must keep using an entry, such as a RADIUS server that needs HMAC-MD5. Grant it to the service's own SID, so that no other program gets it.
-
Find the service's SID. Read its main process ID from
svctl status <service>, then list that process's token groups:The service SID is the group that begins
S-1-5-80-. -
Create the exception, named for its owner and purpose. This one allows HMAC-MD5 for one service:
Name each entry as an algorithm and an operation.
md5.hmacdoesn't allowmd5.digest. The descriptor needs an owner,O:SYhere, as an access check refuses one without, and a DACL granting the Use right,0x1. -
Check that cryptod published it, and didn't drop it:
A
cryptod.policy.failedrecord naming the exception says why it was dropped. A dropped exception allows nothing. -
Restart the service, so that it reads the new policy:
Raise the reject threshold #
-
Set the lowest grade the policy allows. This refuses everything graded U or D:
-
Check that cryptod published the policy, as above. If a
cryptod.policy.failedrecord says a setting is invalid, cryptod kept the previous policy: correct the value and check again. -
Restart the services that should take up the new policy. Processes started from now on use it; running ones keep the policy they started with.
To refuse everything FIPS 140-3 doesn't approve, whatever its grade, set
Reject\FIPS to 1:
Check the result #
Watch for refusals and new warnings after the change:
A program refused an algorithm reports an error from its own calls, such
as a failed TLS handshake with an insufficient_security alert. If a
service stops working, give it an exception or lower the threshold, then
restart it.
To undo a change, set the value back, or delete it to return to Peios's default, then restart the affected services:
cryptod Reference
Peios / Using Peios / Crypto Policy
cryptod compiles Machine\System\Cryptography into the policy file that
libpcrypto reads, and records what processes report of their weak
cryptography. Its configuration is documented by regman, and its records
by evman.
Service #
| Property | Value |
|---|---|
| Service | cryptod |
| Program | /usr/sbin/cryptod |
| Identity | Service: its own SID, S-1-5-80-2691053820-547492864-353945177-641201782-1210658655 |
| Privileges | SeChangeNotifyPrivilege, SeAuditPrivilege |
| Readiness | Notify, once it has published the policy and is listening |
| Event root | cryptod |
cryptod must run as its own service SID. Processes trust a policy copy only if SYSTEM or that SID owns it, and a file cryptod writes is owned by its token's user.
Files and sockets #
| Path | What it is |
|---|---|
/run/cryptod/policy | The current policy |
/var/state/cryptod/policy | The policy kept across reboots, for processes that start before cryptod |
/run/cryptod/report | Where processes report, a SOCK_SEQPACKET socket everyone can connect to |
/run/cryptod/posture | Where the posture is served, a SOCK_STREAM socket for SYSTEM and Administrators |
/usr/share/peios-crypto/algorithms.tsv | Every graded entry, which cryptod checks policies against |
A process reads /run/cryptod/policy, then /var/state/cryptod/policy,
then uses Peios's defaults: refuse only the floor, warn below C, FIPS
ignored, exceptions allowed to override refusal. It moves to the next if a
copy is absent or can't be used, and reports why.
cryptod writes each copy whole: to a new file beside it, which it gives
the copy's descriptor, then renames over the copy. Each copy's descriptor
is protected, grants full access to SYSTEM and cryptod, and grants reading
to Everyone, S-1-15-2-1 and S-1-15-2-2, so that confined applications
can read it too. Both directories grant the same readers traversal.
algorithms.tsv has one line per entry: its identifier, its grade or
floor, and 1 or 0 for whether FIPS 140-3 approves it, separated by
tabs. cryptod doesn't start without it.
Trusting a copy #
A process uses a copy only if its descriptor shows that nobody but SYSTEM and cryptod could have written it:
- Its owner is SYSTEM or cryptod's SID.
- It has a DACL. A copy with none lets everyone change it.
- No entry of the DACL grants anyone else a right that could change the file: writing or appending data, writing extended attributes or attributes, deleting it, changing its descriptor or owner, or a generic or maximum-allowed right that includes them. Entries that deny, and entries that only pass to children, are ignored.
The check fails closed. A descriptor over 4 KiB, or an entry granting
CREATOR OWNER a right to change the file, is refused as insecure, even
where it would be harmless. A process that refuses a copy reports
copy-insecure.
The policy file #
The file is version 1 of a binary format, at most 1 MiB less one byte. Integers are big-endian. A process reads the whole file before using any of it, and refuses a file of another version.
| Field | Size | Meaning |
|---|---|---|
| Magic | 8 bytes | PEIOSCPL |
| Version | 2 | 1 |
| Reject below | 1 | A grade: 0 for U, then 1 to 4 for D to A |
| Warn below | 1 | A grade, as above |
| Flags | 1 | 0x01 reject non-FIPS, 0x02 warn non-FIPS, 0x04 exceptions can override refusal |
| Exception count | 2 | The number of exceptions that follow |
Each exception follows in turn:
| Field | Size | Meaning |
|---|---|---|
| Name | 1-byte length, then the name | Owner.Purpose |
| Flags | 1 | 0x01 warn about its use |
| ProgramSecurity | 2-byte length, then the descriptor | A self-relative security descriptor |
| Entry count | 2 | The number of entries that follow |
| Entries | each a 1-byte length, then the identifier | Such as md5.hmac |
cryptod resolves Exceptions\Enabled, WarnByDefault and WarnAlways
as it compiles, so the file holds only what applies. It leaves out
exceptions it dropped. A process ignores an entry it doesn't grade, and
any entry on the floor.
Reports #
A process connects to /run/cryptod/report, sends one datagram, and
closes. It doesn't wait, and doesn't retry: a report that can't be sent is
lost. A datagram has four fields:
| Field | Size | Meaning |
|---|---|---|
| Kind | 1 | 1 warned, 2 exception used, 3 policy copy unusable |
| Problem | 1 | For kind 3, why; otherwise 0 |
| Entry | 1-byte length, then the identifier | For kinds 1 and 2; otherwise empty |
| Exception | 1-byte length, then the name | For kind 2; otherwise empty |
The problems are 1 unreadable, 2 insecure, 3 malformed, 4 an unknown version, and 5 the process's token unreadable.
cryptod takes the sender's identity from the connection: the user of the token the kernel captured at connect, and the process ID. Nothing in the datagram names the sender. cryptod discards a datagram that libpcrypto couldn't have sent, such as one naming an entry it doesn't grade.
Rates #
cryptod relays at most 512 reports at once from each user, then 8 a
second. It writes its records at up to 80 a second, below the lowest rate
KMES allows a process without SeTcbPrivilege, and queues up to 4096
records when more arrive. A full queue drops its oldest standard record to
make room, and turns a record away only when everything it holds is
essential. The posture counts what's turned away.
Posture #
Connecting to /run/cryptod/posture returns one MessagePack map, then the
connection closes. It describes the policy in force, and what's been used
since cryptod started:
| Key | Value |
|---|---|
policy | The thresholds, flags, and exceptions in force; dropped, the exceptions dropped and why; defaults; and last-failure, a compile that failed since, or nil |
fips | requested; approved-mode, always false while the module isn't validated; reasons; and exceptions-admitting-non-fips |
use | One map per user SID: the exceptions it used, by entry, and the entries it was warned about, each with a count of reports |
turned-away | Counts of reports rate-limited, unattributed, and invalid, and overflow: what didn't fit the queue or a table |
The posture is held in memory, so it starts again when cryptod restarts. Its tables are bounded, at 4096 users and 256 exceptions each.
Services and Jobs
Peios / Using Peios / Services and Jobs
Use Services Manager on the
desktop or svctl in a terminal to see what is running and control it. Both
talk to peinit, the service manager that runs as PID 1. Start with a
status check; change the definition only when the running service needs
different configuration.
Replace jellyfin with the service name you want to inspect. list shows
only services you have permission to query.
Where to start #
| What you need | Start here |
|---|---|
| Check, start, stop, restart, or reload a service | Controlling services |
| Understand Failed, Backoff, Skipped, or Abandoned | Read service states and Troubleshooting |
| Find output from a failed run or hook | Service output and logging |
| Create a service or change its settings | Defining a service |
| Change automatic starts or a schedule | Triggers and timers |
| Diagnose a reduced boot or reboot loop | Boot modes |
| Shut down or reboot deliberately | Shutdown |
For exact field types and defaults, use the Registry key reference. For implementation and protocol details, use the peinit Technical Reference Manual.
Three kinds of object #
| In status or logs | Meaning | What to inspect |
|---|---|---|
| Service | A named definition and its current state. | svctl status <service> |
| Job | One execution of a service, hook, health check, or submitted program. A restart gets a new job ID. | The job ID in status and the matching logs. |
| Operation | One request to start, stop, restart, reload, or reset a service. | svctl operation-status <id> when a command returned without waiting. |
See Jobs and operations to follow a run or submit a one-off job.
peinit in one sentence #
peinit starts services from registry definitions, runs each under its
configured identity, supervises it, and stops services in dependency order at
shutdown. You use svctl or Services Manager to request those actions.
What peinit is not #
Service definitions live under Machine\System\Services\ in the registry.
There are no systemd unit files or Windows SCM commands to edit or translate.
Use Defining a service for
configuration and Service
types for programs
that need to stay in the foreground.
Logs and durable history belong to eventd. Open Logs… for a service in Services Manager, or follow Service output and logging. The TRM compatibility notes describe the interface boundaries.
The one operational invariant #
peinit uses a cached service configuration. A saved change can wait for the next start or another relevant operation; it does not necessarily change a running process. Check when configuration changes apply. The event-loop design explains why.
Where peinit sits in the system #
The service's Identity controls what its process can access. Its ServiceSecurity permissions control who can manage it. Permission to edit its registry definition is separate again. See Service identity and Who can manage a service. The TRM system map covers the components behind these checks.
Controlling Services
Peios / Using Peios / Services and Jobs
Use svctl to inspect and control services from a terminal, or Services Manager on the GXWI desktop. Start by checking the service before issuing a command that interrupts it.
Use the name from the list in place of jellyfin. The command form is
svctl <command> [service] [flags]. To investigate a failure, keep the
state, cause, job ID, and warnings, then open the service's
logs.
Reading status #
Read state and cause together, then check health and warnings:
| Detail | How to use it |
|---|---|
state, cause | Tell whether the service is running, waiting to retry, skipped, or failed, and why. See service states. |
status_text, progress | The latest information the service reported. These clear on restart and can be absent. |
current_job | Identifies this execution. Use its GUID to separate its logs from previous runs. |
current_operation | Identifies an action in progress. Poll its ID with svctl operation-status <id>. |
health | healthy, unhealthy, unknown (no check result yet), or null (no check configured). |
warnings | Notices such as leaked cgroups. Read these before trying another start. |
definition_removed | A deleted definition still has a draining instance. stop still works; start, restart, and reload do not. |
granted | Your query, start, stop, and reload rights. A visible service does not imply permission to change it. |
timers | Next scheduled occurrence, actual firing after jitter, last firing, or a reason the timer could not be armed. |
An Active service has met its configured readiness check. With
Readiness=Alive, that only confirms the process exists; it does not prove
the application is serving requests.
For a scheduled service:
$ svctl status logrotate
logrotate: inactive
cause: clean_exit
timers:
*-*-* 02:00:00
next: 2026-06-02T02:00:00Z, firing at 2026-06-02T02:07:12Z after jitter
last fired: 2026-06-01T02:03:40Z
svctl prints timer times in UTC, to the second. Services Manager shows them
in local time. svctl list has a NEXT TIMER column for each service's
soonest firing. Jitter is already included in the actual firing time.
list omits services you cannot query. job list does the same for jobs. An
operation ID expires after its terminal retention grace; a submitted job is
retained for 60 seconds after it ends. For older results, look in
eventd. The TRM client
examples
retain the full JSON views and field formats.
Manager #
On a GXWI desktop, Services Manager does the same from a window. It lists every service, shows what the selected one is doing (its state and why, its process, the account it runs as, how long it has been running, anything it has reported), and offers Start, Stop, Restart, Reload and Reset. The same commands are on each row's right-select menu. Type in Find a service to narrow the list by name or description.
Services Manager is another client of the same control socket, so it has exactly your authority and no more:
- A command is offered only where it will act. A button is available only if you hold the right the command needs (see the table below) and the service is in a state where the command does something (see the command × state matrix). Otherwise the button is unavailable. The details pane says which commands you can use on the selected service.
- Commands do not block the window. A command is sent without waiting. Services Manager follows its operation and reports the result, such as "SSH server was restarted." or the reason it failed.
- Hidden services are listed, not silently dropped.
listomits the services you cannot query. If you can read the service definitions in the registry, Services Manager still lists those services, marked Not yours to see, and says how many there are. - If peinit does not let you connect at all, Services Manager says so. By default the control socket admits everyone who is signed in, but it can be locked down. Any definitions you can read are still listed, and no command is offered.
- Its definition opens in a window of its own, from Edit definition…
in the details pane or on a row's menu. New service… on the bar defines
one. Both are covered in Defining a
service,
with
svctl definition, which does the same from a terminal. - Who can control a service, and who can change its definition, open from the details pane in the permissions editor. They are covered in Who can manage a service.
- What it has logged opens in Event Viewer, from Logs… in the details pane or on a row's menu. The window shows the service's lines and those of its hooks and health checks, newest first and as they are written. See Event Viewer.
- Timers show when they run. The Next run column shows when each
service's soonest timer
fires. The details pane lists each timer under its schedule, with its next
run and its last run, in the machine's local time. A timer with jitter says
that its run is put back by a random delay, and the next run shown already
includes that delay. A timer peinit could not arm says why it never runs.
These are peinit's own figures, read from
status, not worked out from the definition.
peinit doesn't announce state changes, so Services Manager asks it for the
services' state every two seconds. Press F5, or select Refresh, to ask
straight away. What the registry holds is different. That covers which
services are defined, who can control them, and what you can change. Services
Manager watches the Services key for changes and reads it again only when
something changes, so a change made elsewhere, from svctl or another window,
shows at once.
Before changing a service #
- Start begins the full start sequence and can start dependencies.
- Stop interrupts the service. A
BindsTodependent stops with its target; aRequiresdependent that is already running does not. See Dependencies. - Restart stops and starts as one operation, replacing the current process. Use it when a definition change needs a new process.
- Reload asks the running program to re-read its own configuration.
reload-configinstead asks peinit to re-read service definitions. Neither promises to apply launch-only settings to an existing process. - Reset clears Failed, Abandoned, or Skipped to Inactive; it does not start the service or repair the cause.
After the action finishes, run svctl status <service> again. If it failed or
only returned an advisory reload result, follow the troubleshooting
guide before repeating it.
Service commands #
| Command | Does | Required right |
|---|---|---|
start | Run the service through its full start sequence. | SERVICE_START |
stop | SIGTERM, then SIGKILL after StopTimeout. | SERVICE_STOP |
restart | Stop then start, as one operation. | SERVICE_STOP + SERVICE_START |
reload | Re-read configuration (ExecReload, or SIGHUP). | SERVICE_INTERROGATE |
reset | Clear Failed/Abandoned/Skipped → Inactive. | SERVICE_STOP |
status | Report state, cause, PID, uptime, health, current job and operation, warnings, and when each timer fires. | SERVICE_QUERY_STATUS |
list | List services, their states, and their next timer firing (filtered to what you can query). | (per-service SERVICE_QUERY_STATUS) |
Wait semantics #
By default, a lifecycle command blocks until its operation reaches a
terminal state — start waits for Active (or Failed), stop waits for
Inactive, and so on. Pass --no-wait to get the operation_id back
immediately and poll with operation-status instead.
| Command | Default | Waits for |
|---|---|---|
start | wait | Active (Simple) / Completed or Inactive (Oneshot), or Failed |
stop | wait | Inactive |
restart | wait | the successful start target, or Failed |
reload | no-wait | (with --wait) the Reloading state to resolve |
reset | immediate | — |
reload is the exception — it returns immediately by default, because a
reload can have no observable completion. With --wait, the response carries
a mode:
mode | Meaning |
|---|---|
confirmed | The service signaled READY=1 (and, for a command reload, the command exited 0). |
advisory | The reload was issued and the detection window elapsed without explicit confirmation. |
failed | The ExecReload command exited non-zero or timed out. The service stays Active — a failed reload never takes down a running service. |
The detection window is a fixed 2 seconds — it is built in and is not
configurable through the registry. If the service says nothing within that
window, the reload resolves as advisory and the service stays Active.
System commands #
| Command | Does | Required right |
|---|---|---|
shutdown <type> | Graceful shutdown. type is poweroff, reboot, or halt. | SYSTEM_SHUTDOWN |
boot | Report this boot's mode, reason, and confirmation status. | SYSTEM_QUERY_STATUS |
reload-config | Re-read all definitions and rebuild the graph (atomic). | SYSTEM_RELOAD_CONFIG |
operation-status <id> | Report the state of an operation by GUID. | SERVICE_QUERY_STATUS on its target |
Job commands #
Submitted jobs are reachable
from two places, and svctl job covers both. Querying and stopping a job is
administration and goes over the control socket; submitting a job, waiting
on it, and signaling it belong to its submitter and go over the jobs
socket at /run/services/peinit/jobs.sock (--jobs-socket overrides the
path). Every job command is checked against the job's own descriptor,
which by default admits the submitter, SYSTEM, and Administrators.
| Command | Socket | Does | Required right |
|---|---|---|---|
job list [filters] | control | List the jobs you can query. Filters: --submitter SID, --identity SID, --logon-session N, --state created|running|completed|failed|abandoned; all given filters must match. | per-job JOB_QUERY (others omitted) |
job status JOB_ID | control | The job view. | JOB_QUERY |
job stop JOB_ID | control | SIGTERM, then SIGKILL of the job's cgroup after its stop_timeout. Waits for the job to end by default; --no-wait returns the view as it then is. | JOB_STOP |
job submit [options] IMAGE [ARG...] | jobs | Submit IMAGE as a job running as your own primary token, and print its view once it is running (or has failed to start). With --wait, wait for it to end too. | connect to the jobs socket |
job wait [--for ready|terminal] JOB_ID | jobs | Block until the job is terminal (default) or has sent READY=1, then print the view. --for ready on a job without a readiness protocol is INVALID_STATE. | JOB_QUERY |
job signal JOB_ID SIGNAL | jobs | Send one signal (a number, or a name like SIGUSR1) to the job's main process. Only the main process, only while running. | JOB_SIGNAL |
$ svctl job list --state running
JOB STATE SUBMITTER IDENTITY PROGRESS DESCRIPTION
5f2a... running S-1-5-21-...-1001 S-1-5-21-...-1001 3/5 items nightly backup
$ svctl job status 5f2a...
$ svctl job stop 5f2a...
$ svctl job submit --description "nightly backup" --timeout 3600 -- /usr/bin/backup --full
$ svctl --wait job submit --env MODE=full /usr/bin/backup # exits 0 only if the job completed
$ svctl job wait --for ready 5f2a...
$ svctl job signal 5f2a... SIGHUP
job submit takes the definition fields as options: --description TEXT,
--cwd DIR, --env NAME=VALUE (repeatable), --timeout SECS,
--stop-timeout SECS, --readiness none|notify, --readiness-timeout SECS
, --success-exit-code N (repeatable), --security-descriptor SDDL. Two
hand the job something of yours: --fd NAME=FD passes a descriptor of the
svctl process to the job under NAME (from descriptor 3, with LISTEN_FDS
/LISTEN_FDNAMES set), and --output attaches svctl's standard output as
the job's output sink, so the job's lines appear on your terminal as well as
in eventd. Everything after IMAGE belongs to the job, options included; use
-- before an image path that starts with a dash.
The CLI has no way to attach a token, so a svctl -submitted job always runs
as the caller. Running a job as someone else is a programmatic act — a
service attaching the token of the client it is impersonating — and is
described in Jobs and
operations.
The command × state matrix #
A command sent to a service in an unexpected state returns an error, not a silent no-op. This matrix is the authority on what each command does in each state:
| Command | Inactive | Starting | Active | Reloading | Stopping | Completed | Backoff | Failed | Abandoned | Skipped |
|---|---|---|---|---|---|---|---|---|---|---|
| start | Start | MERGE | ALREADY | ALREADY | QUEUE | Start | DEFER | Start | ERROR | Start |
| stop | NOOP | Cancel+Stop | Stop | Stop | MERGE | Clear | Cancel | NOOP | ERROR | NOOP |
| restart | Start | QUEUE | Restart | Restart | QUEUE | Start | Restart | Start | ERROR | Start |
| reload | ERROR | ERROR | Reload | MERGE | ERROR | ERROR | ERROR | ERROR | ERROR | ERROR |
| reset | NOOP | ERROR | ERROR | ERROR | ERROR | ERROR | ERROR | Clear | Clear | Clear |
| status | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
Legend:
- MERGE — an operation of this type is already running; your command merges into it and you get its GUID.
- DEFER — your
startis accepted and creates a Pending start operation, but it does not run yet: it waits out the service's existing backoff deadline and then starts. If a deferred start is already waiting, you merge into it and get its GUID. - ALREADY — already in the target state; returns the current status, not an error.
- QUEUE — queued as Pending; runs after the current operation finishes.
- NOOP — no effect; returns the current status.
- Clear / Cancel — clear the state to Inactive / abort the current operation, then proceed.
- ERROR — invalid for this state; returns an error with an explanation.
The Backoff column is the
subtle one: the service is down with an automatic restart pending, so start
is deferred — it creates a Pending start that honors the remaining backoff
delay and only runs once that deadline expires (a second start merges into
the one already waiting), stop cancels the pending restart and any deferred
start (the service goes Inactive), restart cancels the automatic one and
does an admin restart, and reload /reset are invalid because no process
exists.
Error codes #
An error response is {"status": "error", "code": "...", "message": "..."}.
The code is one of:
| Code | Meaning |
|---|---|
ACCESS_DENIED | AccessCheck denied the command against the target descriptor. |
UNKNOWN_SERVICE | No such service definition (also returned for start/restart/reload on a definition-removed service). |
UNKNOWN_OPERATION | No such operation GUID — never existed, or dropped after its retention grace. |
UNKNOWN_JOB | No such job GUID — never existed, or dropped after its retention grace. A known job you cannot query returns ACCESS_DENIED. |
MALFORMED_REQUEST | The request line is not a single valid JSON object. |
REQUEST_TOO_LARGE | The request exceeds MaxRequestSize. |
INVALID_COMMAND | The command field is missing or unknown. |
INVALID_ARGUMENTS | A required field is missing or malformed (for example shutdown with no valid type). |
INVALID_STATE | Not valid for the service's current state (an ERROR cell above), or rejected because the system is already shutting down. |
OPERATION_TIMEOUT | A --wait operation did not reach a terminal state within its timeout. |
INTERNAL_ERROR | peinit hit an internal failure executing the command. |
The jobs socket uses the same envelope and codes, plus two of its own:
| Code | Meaning |
|---|---|
QUOTA_EXCEEDED | The submission would exceed MaxJobsPerSubmitter live jobs for your SID. Nothing was created. |
BAD_TOKEN | The token attached to a submission cannot be a job identity — more than one was attached, its impersonation level is below Impersonation, or it could not be duplicated. |
The message is human-readable and non-normative — read it for context, key
off the code.
Exit status #
| Code | Meaning |
|---|---|
0 | The command succeeded. For job submit --wait, the job also completed. |
1 | peinit refused the command — an access denial, unknown service or job, invalid state, or timeout — or a job submit --wait job ended other than completed. |
64 | A usage error. |
69 | peinit could not be reached — the socket is missing or refused the connection. |
70 | A protocol error — peinit answered with something the client could not read. |
How the control interface works #
Both tools use /run/services/peinit/control.sock. Connection admission and
each service action are access-controlled. The default socket admits signed-in
users; the target's permissions decide which commands they can run.
Lifecycle commands create an operation ID you can follow. Concurrent identical requests can merge into one operation. For JSON framing and complete response examples, see the control-client reference.
Connection limits #
peinit enforces hard limits on the control socket, all tunable under
Machine\System\Init\:
| Key | Default | Limits |
|---|---|---|
MaxControlConnectionsPerUser | 16 | Concurrent client connections one user can hold; SYSTEM is exempt (excess are refused at connect). |
MaxControlConnections | 256 | Concurrent client connections in all (excess are refused at connect). |
MaxRequestSize | 65536 | Bytes per request. |
ConnectionTimeout | 30 | Seconds an idle connection can sit before it is closed. |
The jobs socket has its own set, under the same key:
| Key | Default | Limits |
|---|---|---|
MaxJobsConnections | 64 | Concurrent jobs-socket connections (excess are closed at connect, with no response). |
MaxJobMessageSize | 32768 | Bytes per message — which bounds a submission's whole definition. |
JobsConnectionTimeout | 30 | Seconds an idle jobs connection can sit before it is closed. A connection blocked on a wait or a pending submit is not idle. |
MaxJobsPerSubmitter | 64 | Live jobs one submitting SID can hold. SYSTEM is exempt. |
Where to start #
To understand the states the matrix refers to, read The service lifecycle.
To understand the operations every lifecycle command creates and how to poll them, read Jobs and operations.
To configure who can run each command, read Who can manage a service.
Managing Services in Services Manager
Peios / Using Peios / Services and Jobs
Services Manager distinguishes a service's running state from the persistent definition peinit reads. Starting or stopping a service changes its runtime; editing the definition changes how it is configured.
Before you start #
You need Services Manager in a GXWI session. Runtime control uses peinit's service rights. Editing a definition uses registry rights, which are a separate permission check.
Control a service #
- Open Services Manager and use Find a service to narrow the list.
- Select the service and read its state, reason, process, account, recent report, and timers. Timer times are shown in local time.
- Choose the available runtime action, such as Start, Stop, Restart, or Reload, after checking its effect.
- Read the command's outcome. Select Logs to open the service's recorded output in Event Viewer when more context is needed.
Check the result #
The state refreshes every two seconds. Refresh or F5 reads it at once. Confirm the intended state and inspect any failure reason. A button being available does not guarantee that the service will start successfully.
Edit a definition #
Open Edit definition for an existing service or New service for a new one. Review the grouped fields and save with Save or Ctrl+S. The editor validates the fields and writes changed values in one registry transaction. Check peinit's resulting state rather than assuming that a saved definition restarted an existing process.
The permissions for controlling a service and changing its definition are
separate dialogs. Default permissions concerns services without their
own service descriptor. A registry definition you can read can remain
visible even when peinit refuses access to the service's runtime state.
See gxwi-services-manager(1) and svctl(8).
Finding Service Logs
Peios / Using Peios / Services and Jobs
In Services Manager, select the service and choose Logs…. It opens Event Viewer with the service's lines and the output of its hooks and health checks, newest first and updating as they arrive.
For terminal queries, use evctl. peinit forwards output; eventd stores and queries the records it receives.
Find the failed run #
- Run
svctl status <service>and note its state, cause, current job ID, and warnings. - Open Logs… and inspect the time around the failure. Hook and health-check output can explain a start or health failure even when the main process wrote nothing.
- Match the job GUID to isolate one execution. A restart has a new job ID.
- For earlier attempts, look for
peinit.job.started,peinit.job.ended, and the operation events in eventd. The live job or operation can already have expired.
Log origins identify the producer: the service name, a hook such as
jellyfin/ExecStartPre[0], or jobs/<id> for a submitted job. A log's
stream tells you stdout or stderr, not whether the line necessarily describes
an error.
Capturing output #
peinit captures stdout and stderr, including hooks and health checks, and tags
lines with the origin, stream, timestamp, and job GUID. A submitted job cannot
opt out of forwarding; --output requests an additional live copy.
Pipe wiring and tagging are described in the output-flow reference.
Logs and events have different limits #
Service logs and structured events take separate paths:
| Record | Path | What to expect |
|---|---|---|
| Service stdout/stderr | peinit's output buffer and eventd's log socket | Best-effort; lines can be truncated or dropped under load. |
| Job, operation, access-check, and failure events | KMES, then eventd | Independent of the log socket. KMES holds a finite in-memory record; eventd supplies stored history. |
Do not assume an event has survived a reboot merely because it was emitted. The kernel ring is not persistent, and it can overwrite older events if consumers fall behind. See KMES failure modes for those limits and Auditing for event storage and queries.
The pre-eventd buffer #
Before eventd is available, peinit holds output in memory, by default up to
PreEventdBuffer=1048576 bytes. Overflow drops the oldest lines. The buffer
is replayed when eventd is ready, but it is not persistent storage and cannot
guarantee a complete boot log.
The buffer reference explains the early-boot path.
Flood protection #
A [truncated] marker means a line exceeded MaxLogLineLength (8192 bytes by
default). Output delivered faster than peinit can read can block the service's
writes at its pipe; downstream delivery to eventd is loss-tolerant.
If a submitted job's live output has gaps, look for
peinit.job.output.dropped. That reports loss in the extra output copy, not
necessarily loss in eventd; query eventd separately. Ordinary log delivery
remains best-effort there too.
See the registry limits before changing buffer sizes and the TRM flood-control detail for the implementation.
The eventd handoff #
When eventd reaches Active, peinit replays buffered output and forwards new lines. If eventd exits, peinit resumes buffering and repeats the handoff when it returns. Missing log lines around that interval can reflect buffer overflow or lossy delivery; an empty query alone does not prove the service wrote nothing.
Access policy can also hide records from a query. Check who can read what if the expected origin is absent. The handoff reference describes transport behavior.
Console output #
peinit writes boot progress, shutdown progress, recovery entry, and critical
failures to /dev/console. Service output is not echoed there by default. A
terminal-attached service is the exception because it writes directly to its
terminal.
peios.quiet can suppress peinit's console messages, and suppressed messages
are dropped rather than saved for later. See console noise
settings
when investigating a boot problem.
Where to start #
For symptom-based next steps, use Troubleshooting. For finding older executions or actions, use Jobs and operations. For query tools, use Event Viewer or evctl.
Troubleshooting a Service
Peios / Using Peios / Services and Jobs
Collect the current state and cause before changing anything:
Keep the job or operation ID and any warnings. Open Logs… for the service in Services Manager to inspect its main process, hooks, and health checks. For older attempts, query logs and events; live status is not a permanent history.
Use the symptom below to choose the next check. Avoid repeating a restart or changing permissions until you know which layer failed.
A service won't start #
status shows it Failed or Skipped. The cause says why:
| Cause | What happened | What to do |
|---|---|---|
ValidationError | The definition is malformed — a bad field, an unresolvable conflict, an illegal health-check timing. | Check the logs for the specific field. Fix the definition; the message names what is wrong. |
DependencyFailure | A Requires/BindsTo target failed or does not exist. | Fix the target first — status it. The dependent recovers once the target can start. |
ConditionSkipped (→ Skipped) | A start-time condition was not met. Not a failure — the service decided it does not apply here. | If it should run, the condition's premise is false (a missing path/file/key). This is often correct behavior. |
TtyUnavailable (→ Skipped) | Another service is holding the terminal this one names in TTYPath. Not a failure — it is waiting its turn. | Check who has it: the holder is the other service with that TTYPath in a running state. Give this one a higher TTYPrecedence to win next boot, or a tty:released trigger so it starts when the terminal frees. |
AssertionError | A start-time assert failed — a required precondition is missing. | Create the missing precondition (path, file, directory, registry key), then start again. |
PreHookFailure | An ExecStartPre hook exited non-zero. | Inspect the hook's captured output and its identity. Before rerunning it manually, check for side effects: setup and migration hooks can change data. |
ParentSetupFailure | peinit could not even fork — fd/PID exhaustion, a cgroup error. No process was created. | A system-resource problem, not the service's fault. Check for fd/PID limits and cgroup health. |
PreExecFailure | Setup after fork failed — token install, rlimits, environment. | Usually identity: check Identity, that authd is up, and that RequiredPrivileges names real privileges. |
ReadinessTimeout | The process started but never became ready within StartTimeout. | Either the service is genuinely slow (raise StartTimeout, or have it send EXTEND_TIMEOUT_USEC) or it never sends READY=1 (wrong Readiness, or a bug). |
A service keeps restarting #
The service flaps — up, down, up, down. This is restart policy doing its job, but it points at an unstable service.
- It eventually settles in
FailedwithRestartBudgetExhausted. It crashedRestartMaxRetriestimes faster than it could stay healthy forRestartWindow. The fix is the service, not the policy — read its logs for the crash. Raising the budget only delays the inevitable. - It flaps forever and never exhausts the budget. Check whether it stays
Active for the full
RestartWindowbetween failures. Reaching Active briefly does not reset the budget. Inspect the health-check output too; a faulty check can restart a working service. - It restarts on a clean exit you did not expect.
RestartPolicy=Alwaysrestarts even successful exits (causeCleanExitRestart). If the service is meant to exit, useOnFailureinstead.
The machine keeps rebooting #
Preserve the last console error and any service records before attributing
repeated reboots to a service. If peinit reports a Critical service
exhausting its restart budget, its
ErrorControl=Critical policy makes
peinit sync and reboot. Repeating that failure can produce a reboot loop; the
symptom alone does not establish this cause.
The boot-attempt counter can
break a sequence of boots that reach peinit's counter increment but never
become confirmed: after N attempts (default 3), peinit enters Recovery
mode. If each boot reaches the success grace
before the Critical failure, its counter is reset and the reboot loop can
continue without automatic Recovery. Check svctl boot while the normal
control interface is available; it is unavailable in Recovery. Do not assume
every reboot loop will stop after three attempts, or that peinit can deliver
Recovery if it cannot start.
In Recovery, start with the failure reason on the console. Phase 2 services
are skipped, so stored eventd history is not automatically queryable from that
shell. Where a supported running eventd query service is available, use Find
service logs and Find missing
records to investigate earlier
attempts. evctl queries that service; it does not open stored databases
offline. Otherwise, retain the console evidence for the administrator or
provider's recovery procedure.
Once the evidence identifies a Critical service failure, repair its cause or
restore known-good configuration through a supported recovery path before
rebooting. Disabling a required platform service can leave its dependents
unable to start. If you need to intervene before the counter trips, boot with
peios.recovery=1 on the kernel command line.
Abandoned #
Abandoned means peinit SIGKILLed the process but it survived — stuck in
uninterruptible kernel sleep (D-state), the signature of hung I/O (a dead
NFS mount, a failing disk). Nothing in userspace can kill a D-state process.
- The underlying I/O fault is the real problem — investigate the storage or mount, not peinit.
- The service's cgroup is leaked and shows in
warnings. A later start uses a fresh generational cgroup, so the new instance is unaffected. svctl reset <service>clears the Abandoned state and re-checks the cgroup: if the stuck process finally died, peinit cleans up; if not, it stays leaked and warns you. Leaked cgroups clear fully only on reboot.
I changed the config and nothing happened #
peinit works from an in-memory snapshot, and each field has a mutability class that decides when a change applies:
- Immutable at runtime (
ImagePath,Type,Identity,RequiredPrivileges,ErrorControl) → takes effect only onrestart. - Apply on next start (dependencies, conditions,
OnFailure) → next start or graph reload. - Reloadable at runtime → next relevant operation. Timeouts and health-check policy can affect later checks; environment, arguments, working directory and process limits apply to a new process, not one already running.
- Hot-reloaded (
ServiceSecurity) → next control request.
If a change is not landing, check its class first. For a wholesale re-read of
every definition, run svctl reload-config — it rebuilds and validates the
whole graph atomically and swaps it in only if validation passes (running
services are untouched). And remember peinit pulls changes from registry
notifications rather than having them
pushed, so there can be a brief lag.
ACCESS_DENIED #
A control command returns ACCESS_DENIED. peinit ran
AccessCheck on your token against the
target's descriptor and the right was not granted:
- A service command needs the matching right in the service's
ServiceSecurity
descriptor (
startneedsSERVICE_START,restartneeds both stop and start, …). shutdownandreload-configneedSYSTEM_SHUTDOWN/SYSTEM_RELOAD_CONFIGin peinit's control descriptor.- The check uses your effective identity at connect time — if you are impersonating, that is what is checked.
Under the default descriptors every denial is recorded by the kernel as a
kacs.audit.access.checked event naming the caller, the target (its object
kind is service, job, or peinit-system) and the rights requested
and granted. Walk it through Debugging a
denial.
A job submission is refused #
A job submit — from svctl or from a service — comes back with an error
rather than a job. The code says which door it hit:
| Code | What happened | What to do |
|---|---|---|
| connection refused, or an immediate close | You cannot reach /run/services/peinit/jobs.sock — its file descriptor does not grant you write, or peinit is at MaxJobsConnections. peinit itself performs no check on who can submit; the socket's descriptor is the whole policy. | Check the socket's descriptor (by default Authenticated Users can connect) and the connection count. |
QUOTA_EXCEEDED | Your SID already holds MaxJobsPerSubmitter live jobs (default 64). | job list --submitter <your SID> to find them; stop what should not be running, or raise the key. SYSTEM is exempt. |
BAD_TOKEN | The token you attached cannot become a job identity: more than one was attached, it is below Impersonation level, or peinit could not duplicate it. | Attach exactly one token obtained by impersonating the client; an Identification-level token is never enough. If the job needs Delegation, set the jobs connection to Delegation before attaching. |
INVALID_ARGUMENTS | The definition is malformed — a relative image_path, a descriptors list that does not match what you attached, a security_descriptor without an owner and DACL. | The message names the field. |
INVALID_STATE | The system is shutting down; submissions are refused. | — |
A job that was accepted but never ran is not an error response: it is an
ok response whose view is failed with a cause — parent_setup_failure
(peinit could not prepare the launch) or pre_exec_failure (the program could
not be executed as that identity, which is where "no such file" and
"permission denied" land, because peinit does not check the image before
accepting a submission).
A job's output has gaps #
If a submitter attached an output sink and sees gaps, look for a
peinit.job.output.dropped event for the job in
eventd: the sink was not being drained fast
enough, and peinit dropped lines for the sink only rather than let it slow
the job. Query eventd under the job's GUID for the independently forwarded
record. Sink loss does not itself drop that record, but eventd's log path is
also best-effort, so completeness is not guaranteed.
UNKNOWN_JOB #
The GUID is unknown or its retention has elapsed. A submitted job is retained
for 60 seconds after it ends, then dropped; check eventd for any stored
record. A known job that you lack permission to query returns ACCESS_DENIED
. job list instead omits jobs you cannot query.
A dependent never started #
You started (or booted) a service, but something that depends on it never came up:
- A
Requires/BindsTodependent stays blocked until its target reaches a satisfying state (Active, Reloading, Completed, or Skipped). If the target is stuck in Starting or Failed, so is the dependent — fix the target. - If a dependent got connection refused on boot, check the target's
readiness setting and startup logs. With
Readiness=Alive, peinit waited only for the process to exist, not to be serving. UseReadiness=Notifyonly if the program supports sendingREADY=1from its tracked main process when ready; changing the setting does not add that support and can causeReadinessTimeout. See the notification contract. If the program cannot signal readiness, have its service or package owner resolve the startup race. peinit's boot validation warning can identify an Alive-readiness dependency; it does not prove the cause of a refused connection. - A
Wantsdependent waits for the optional target's startup attempt to resolve, but starts even if the target failed. UseRequireswhen successful readiness is necessary.
Safe #
Safe mode selects Critical and
SafeMode=1 services within the boot-triggered set. Those flags do not give a
demand-only service a boot trigger. You land here when graph validation finds
a cycle or unresolvable conflict involving a Critical service, or when
peios.safemode=1 is on the kernel command line. The TCB is healthy; the
configuration is broken.
Fix the graph: the logs name the cycle path (A → B → C → A) or the
conflicting pair. Once the cycle is broken or the conflict resolved, a normal
boot returns. You can start any service by hand from Safe mode in the meantime — it is only auto-start that is restricted.
Recovery #
Recovery mode gives you a
SYSTEM shell on the console and skips Phase 2 services. It starts registryd
only if the boot has not already attempted that start. You reach it when the
boot counter hits N, when peios.recovery=1 is set, or when registryd
failed in Phase 1 (Recovery is immediate; this boot attempt has already
incremented the counter).
If the registry itself is failing:
- Preserve peinit's console failure reason and the source's startup diagnostics. A failed registry operation does not prove the source process has exited.
- Identify the installed
registrydprovider and version, its hive declarations and actual database paths. LCS and sources explains the defaultloregdprovider and its diagnostics. - Establish whether the source is already active before any storage work. Recovery can retain a registryd started or attempted earlier in the boot. Do not launch a second source against the same hive files.
- Obtain the installed provider's supported recovery procedure before attempting offline inspection or repair. The source-checked loregd implementation accepts hive declarations and has no offline repair switches. It does not create an automatic startup backup; its orphan cleanup is not corruption repair or backup restoration. Those references identify the checked revision. Verify what recovery copy actually exists and what it contains before planning a replacement.
When the source is serving the required registry operations, Backup and restore describes the supported privileged subtree workflow. That workflow depends on a working source; it does not repair an unavailable source. Restore replaces the target contents and descendants, including security descriptors, so review the target and backup before using it. Role definitions can re-supply service configuration but do not restore every registry value.
Recovery offers no TCB guarantee. Treat the unrestricted SYSTEM shell accordingly, and remember it needs console access (physical, IPMI, or serial); there is no remote recovery yet.
Where to start #
To read states and causes fluently, keep The service lifecycle handy.
For restart, backoff, and Critical-reboot behavior, see Keeping services running.
For the commands and their outputs, see Controlling services.
Read Service States
Peios / Using Peios / Services and Jobs
Run svctl status <service> and read state and cause together. State
tells you where the service is now; cause tells you why it got there. Failed
with ValidationError calls for a definition fix, while Failed with
RestartBudgetExhausted calls for the logs from repeated attempts.
Use the state table below for a quick interpretation, then the troubleshooting guide for the next action. You do not need the full state machine before running a status check.
The states #
| State | Process? | Satisfies dependents? | What it means when you see it |
|---|---|---|---|
| Inactive | No | No | Not started, or stopped cleanly and not set to restart. The neutral resting state. |
| Starting | Maybe | No | Activation in progress — conditions, hooks, fork, or readiness wait. Dependents are blocked. |
| Active | Yes | Yes | Running and ready. The normal state of a healthy Simple service. |
| Reloading | Yes | Yes | Re-reading configuration. Still counts as running. |
| Stopping | Yes (briefly) | No | SIGTERM sent; waiting for exit or SIGKILL escalation. |
| Completed | No | Yes | Oneshot finished successfully. Stays here only with RemainAfterExit=1. |
| Backoff | No | No | A restart is pending; the service is waiting out its backoff delay before the next attempt. |
| Failed | No | No | Exited abnormally and restart policy is exhausted or not configured. |
| Abandoned | Yes (unkillable) | No | SIGKILL was sent but the process survived in uninterruptible sleep (D-state). peinit has given up supervising it; its cgroup is leaked. |
| Skipped | No | Yes | A start-time condition was not met, or its terminal was unavailable. Read the cause. |
Four of these — Active, Reloading, Completed, Skipped —
satisfy dependents. Everything else blocks them. That single column is the
rule the whole dependency system
turns on: a service waiting on a Requires target does not move until that
target reaches one of those four.
Choose the next check #
- Starting: inspect the current operation, readiness configuration, and pre-hook output. The main process can not exist yet.
- Backoff: an automatic retry is already pending. Another
starthonors the existing delay;stopcancels the pending restart. - Failed: read the cause and the failed run's logs before starting again. Definition and dependency faults are not fixed by increasing retries.
- Skipped: inspect the condition or terminal owner. Skipped satisfies dependents and is not itself a failure.
- Abandoned: investigate the underlying I/O fault.
resetclears the state but cannot kill a process stuck in D-state.
Controlling services lists which actions are valid in each state.
Transition causes #
Every transition carries a cause. peinit keeps the cause of the most recent transition on the service, and emits all of them to eventd. The full taxonomy, grouped by what kind of thing happened:
Why a service started
| Cause | Meaning |
|---|---|
ExplicitStart | An administrator or a trigger started it. |
DependencyStart | Started to satisfy another service's dependency. |
RestartPolicy | An automatic restart, after a backoff delay. |
BindsToRecovery | A bound target returned to Active; the dependent is auto-restarted. Does not consume the restart budget. |
Why a service stopped
| Cause | Meaning |
|---|---|
ExplicitStop | An administrator requested stop. |
ConflictEviction | A conflicting service started and won. |
BindsToPropagation | A bound target stopped, so this one stops too. |
ShutdownWave | The system is shutting down. |
Why a service failed or restarted — the diagnostic causes
| Cause | Meaning |
|---|---|
ProcessCrash | The main process exited non-zero or died on a signal. |
CleanExit | A Simple process exited successfully, and policy is not Always — not a crash; goes straight to Inactive. |
CleanExitRestart | A Simple process exited successfully but RestartPolicy=Always, so it is restarted. Logged clearly as not a crash. |
ReadinessTimeout | StartTimeout expired before the service became ready. |
WatchdogTimeout | A WATCHDOG=1 keepalive did not arrive in time. |
HealthCheckFailure | HealthCheckRetries consecutive health checks failed. |
PreHookFailure | An ExecStartPre hook exited non-zero. |
ParentSetupFailure | peinit could not even fork — resource exhaustion, cgroup error. No child was created. |
PreExecFailure | Setup after fork but before exec failed (token install, rlimits, environment). |
RestartBudgetExhausted | RestartMaxRetries reached within the window; no more retries. |
Why a service was rejected — definition and graph problems
| Cause | Meaning |
|---|---|
ValidationError | The definition failed validation (bad field, unresolvable conflict, illegal health-check timing…). |
CycleDetected | The service is part of a dependency cycle. |
DependencyFailure | A Requires dependency entered Failed or does not exist. |
AssertionError | A start-time Assert failed. |
ConditionSkipped | A start-time Condition was not met → Skipped (this is not a failure). |
TtyUnavailable | Another service was holding the TTYPath this one names → Skipped (also not a failure). See Triggers and timers. |
ProcessUnkillable | The process survived SIGKILL (D-state) → Abandoned. |
ExplicitReset | An administrator cleared Failed/Abandoned/Skipped without starting. |
The grouping matters for what peinit does next: the diagnostic causes are mostly restart-eligible (peinit consults restart policy), whereas the definition/graph causes are never restarted — retrying a broken definition cannot help. The distinction is spelled out in Keeping services running.
Abandoned #
Abandoned is the one state that reflects a kernel-level problem rather than
a service-level one. peinit reaches it when it has sent SIGKILL to a service's
process group but the processes are still there after a grace period — the
post-kill timeout, 5 seconds by default. If the service's cgroup has not
emptied within it, the processes are wedged in uninterruptible kernel
sleep (D-state), typically behind a hung mount or a broken storage
controller, and the service is marked Abandoned (its cgroup leaked).
peinit cannot kill a D-state process; nothing in userspace can. So it stops
trying: it marks the service Abandoned, leaks the cgroup (it cannot be removed
while populated), and moves on rather than hanging. The leak is never silent —
it shows up in the service's warnings and, on a later start, peinit creates
a fresh "generational" cgroup so the new instance is unaffected by the stuck
old one.
An Abandoned service is cleared with reset, which re-checks the cgroup: if
it finally emptied, peinit cleans up; if it is still populated, peinit leaves
it leaked and warns you. An Abandoned service is a sign of an underlying I/O
fault that needs investigating, not something to paper over with a restart.
The common path #
Most of a service's life is a small loop. The diagram below shows the states a healthy Simple service moves through, plus the two ways it leaves Active.
stateDiagram-v2
[*] --> Inactive
Inactive --> Starting: start / trigger / dependency
Starting --> Active: ready (READY=1 or alive)
Active --> Stopping: stop / shutdown / conflict
Stopping --> Inactive: exited (clean stop / shutdown)
Stopping --> Failed: exited (conflict / BindsTo eviction)
Active --> Backoff: crash + restart allowed
Backoff --> Starting: backoff delay elapsed
Active --> Failed: crash + no restart
Starting --> Failed: timeout / hook / setup failure
Failed --> Starting: explicit start
A few things this picture makes concrete:
- An automatic restart always routes through Backoff, never through
Failed.
Backoff → Startingis the retry;Failedis reached only when restarts are exhausted or disabled. This is whyOnFailurefires once at the end, not on every retry. Startingcan fail before any process exists — a parent-side setup error, a failed pre-hook, a condition, or assert. The cause records which.Failed → Startingis how a manualstart(or a recovery path) revives a dead service; automatic restarts never originate fromFailed.Stoppinghas two exits. A clean stop or a shutdown lands inInactive. But a service stopped because it lost aConflictsrace (ConflictEviction) or because itsBindsTotarget went away (BindsToPropagation) comes to rest inFailed, carrying that cause — so an evicted or bound-out service shows as Failed instatusand needs areset(or, for a bound service, its target returning) before it starts again. It was not shut down on purpose, so peinit does not treat it as cleanly Inactive.
Oneshot services follow a parallel path through Completed instead of
Active: Starting → Completed, and then either staying there
(RemainAfterExit=1) or passing through to Inactive. See Simple and
Oneshot services.
Readiness gating during boot #
The dependent-satisfaction rule is what makes boot orderly. A service's dependents do not start until it satisfies them:
- A Simple service satisfies dependents when it signals
READY=1(Notify) or when its process exists (Alive). - A Oneshot service satisfies dependents when it exits successfully and reaches Completed.
- A Skipped service satisfies dependents immediately — it succeeded by not needing to run.
If a service does not reach readiness within its StartTimeout, its
dependents diverge by relationship: Requires dependents transition to Failed
(DependencyFailure); Wants dependents start anyway. That difference is the
whole point of the two relationship types — see Dependencies and
ordering.
Invariants #
A handful of rules hold without exception:
- A service is in exactly one state at any moment.
- Only the transitions peinit defines are valid — there are no others.
- Only peinit changes a service's runtime state. No external process can reach in and set it.
- A service's securable identity (its ServiceSecurity descriptor — who can manage it) is independent of its process identity (its token — what it can access).
- Readiness is per start generation — a
READY=1from a previous incarnation is never honored for the current start.
Where to start #
To understand what happens after a service crashes — restart policy, backoff, health checks, watchdogs — read Keeping services running.
To understand how dependents block on and are released by these states, read Dependencies and ordering.
To see which commands are valid in which state, read the command × state matrix in Controlling services.
Jobs and Operations
Peios / Using Peios / Services and Jobs
A job is one execution; an operation is one action requested on a
service. Use the IDs from svctl status to follow what is happening. A
service restart creates a new job, so its job ID also distinguishes its output
from the previous run.
job list and job status here are for submitted jobs. For service-run
history, follow the job ID into logs and
events. Live status is
short-lived; eventd is where to look after an ID expires.
Run a one-off job #
Use job submit when you want one supervised execution under your own
identity. For example, if /usr/bin/backup is installed:
Keep the returned ID, then query or wait for it:
To end the whole job, use svctl job stop <job-id>. job signal sends a
signal only to its main process and is not a substitute for stopping its
cgroup. Check the final state and cause: a job that handles a requested
stop and exits successfully is Completed with cause explicit_stop.
A submitted job remains queryable for 60 seconds after it ends. After that, use its GUID in eventd. See job command options and permissions before passing descriptors, changing the job descriptor, or attaching live output.
How they surface #
You meet jobs and operations in four places:
status—current_jobandcurrent_operationgive the GUIDs of the service's active execution and active action (ornull).operation-status <id>— polls one operation to a terminal state; a--waitlifecycle command does this for you under the hood.- **
job list/job status <id>** — the submitted jobs you can query, and one job's view. - eventd — the durable history. Every job and operation lifecycle transition lands there as a structured event, which is how you reconstruct what happened after the objects themselves are gone from peinit's memory.
Jobs: what actually ran #
Every time peinit forks a process — a service's main binary, a pre- or
post-hook, a health
check, or a submitted
job — that single execution is a job, with its own GUID
and exit result. If a service is the what, a job is what actually ran. A
restart does not reuse a job; it creates a new one. The service always
tracks its current job GUID, and a status query reports it.
Jobs come in five types:
| Type | Created for |
|---|---|
ServiceMain | A service's main process. |
PreExecHook | One ExecStartPre command. |
PostExecHook | One ExecStartPost command. |
HealthCheck | One health-check run. |
Submitted | A program submitted over the jobs socket. |
Their lifecycle is simpler than a service's, because a job only tracks a process — not policy:
| State | Meaning |
|---|---|
Created | The job object exists but the process is not forked yet (pre-hooks can be running). |
Running | The process is alive. |
Completed | The process exited successfully. |
Failed | The process failed — or peinit classified the job failed before fork (a parent-side setup error). |
Abandoned | The process survived SIGKILL (D-state). |
A job record carries the things you would want for forensics: the resolved
identity and a token summary, the image path and arguments,
created/started/ended timestamps, the exit code or signal, the cgroup, the
failure cause, and the
operation_id that created it (null for submitted jobs). The clean division
of ownership is: the service owns policy (restart, dependencies, health
schedule, current state); the job owns the execution facts (PID, exit,
timestamps, identity, cgroup, log correlation).
Retention and log correlation #
For service executions, peinit keeps only active job records in memory. When
a job reaches a terminal state it emits a structured event (through KMES)
carrying the full record, then drops the job. Submitted jobs retain a terminal
view for 60 seconds, as described below; peinit keeps no durable job
history — eventd is the historian, consuming those
events from the kernel ring buffer. The lifecycle events are
peinit.job.created, peinit.job.started, and peinit.job.ended; a
submitted job also emits peinit.job.status.reported as its progress changes.
peinit.job.created and peinit.job.status.reported are verbose events,
off unless the event emission policy (Machine\Generic\Events, PGSS §6.9)
turns them on.
Separately, captured job stdout /stderr is forwarded to
eventd tagged with the job's
GUID. A service with TTYPath writes to its terminal instead; see the
terminal-attached service
exception. The
GUID lets a query like "show me the logs for job X" distinguish that
execution's records from the run before or after it.
Operations: what was requested #
An operation is a first-class object representing a requested state-machine action on a service. Rather than letting control commands mutate state directly, peinit turns each one into an operation that is validated, queued, and executed by its event loop. This is what gives concurrent callers — admin tools, automated triggers, dependency propagation — explicit, observable conflict resolution instead of races.
There are five operation types — Start, Stop, Restart, Reload,
Reset — and each carries a source recording why peinit created it:
| Source | Created by |
|---|---|
Admin | A control client. |
Boot | The Phase 2 boot lifecycle. |
Shutdown | The shutdown lifecycle. |
DependencyPropagation | A start pulling in a dependency. |
RestartPolicy | An automatic restart. |
Timer | A timer firing. |
BindsToRecovery | A bound target returning to Active. |
BindsToPropagation | A bound target stopping. |
ConflictResolution | A Conflicts eviction. |
OnFailure | A failed service's fallback handler. |
The source is why a status showing
current_operation.source: "restart_policy" tells you the service is being
auto-restarted, while "admin" tells you a person asked.
Operation lifecycle #
flowchart LR
P["Pending"] --> R["Running"]
R --> C["Completed"]
R --> F["Failed"]
R --> A["Aborted"]
P --> M["Merged"]
P --> X["Cancelled"]
P --> F
| State | Meaning |
|---|---|
Pending | Validated and queued, waiting on a precondition (for example a prior stop to finish). |
Running | Executing — the service is transitioning. |
Completed | Achieved its goal (start reached Active/Completed; stop reached Inactive/Failed). |
Failed | Did not achieve its goal — including timing out while still Pending. |
Merged | Folded into an identical operation already in flight (records the survivor's GUID). |
Cancelled | Terminated while still Pending — never ran. |
Aborted | Terminated while Running — interrupted in progress. |
Cancelled and Aborted are the same idea at two points: canceled never ran,
aborted was running. The reason (admin action, supersession) is a property
of the event, not the state.
Conflict resolution and merging #
When a command arrives for a service that already has an operation in flight, peinit resolves the collision deterministically — the same logic the command × state matrix summarizes:
- Same type (start over start, stop over stop, reload over reload) → merge. The new caller transparently receives the existing operation's GUID; from their side, their request is in progress.
- Stop wins over start. An explicit stop cancels a pending start or aborts a running one. The admin said stop.
- Later supersedes earlier, and a start while a stop is in flight is queued to run after the stop.
Timeout and retention #
An operation inherits its target's timeout as its maximum lifetime —
StartTimeout for start/reload/reset, StopTimeout for stop, and the sum of
both legs for restart. Crucially, the clock starts at operation creation,
including queue time — from the caller's perspective they have been waiting
since they sent the command, so a long queue can time an operation out before
it even runs.
Operations are emitted as events (peinit.operation.requested, .started,
.ended, and .merged; one .ended covers completed, failed, canceled and
aborted, and says which) and terminal ones are dropped from memory after a
short grace (default 60 s — long enough for a polling client to read the
result). As with jobs, peinit keeps no operation history; eventd does.
Submitted jobs #
A submitted job is a program peinit runs once, under supervision, because a process asked it to — not because a definition in the registry said so. Two situations motivate it:
- A task on a client's behalf.
backupdtakes a request from a user, and wants the backup to run as that user, in its own cgroup, with a timeout, reporting progress, visible injob list— but supervised by peinit rather than bybackupditself. - A session. A logon service (say, a web front-end) has authenticated a user and wants a long-lived per-logon process running as them, with a socket it can talk to, that it can stop when the session ends.
Both are the same mechanism: a jobs socket at
/run/services/peinit/jobs.sock, separate from the control
socket. A submitter connects,
sends a job definition, and gets back the job's view and — while the job runs — a handle to its process.
Who can submit #
Being able to connect is the permission. peinit performs no access check of its own on a submission; the check is the one the kernel performs against the socket file's security descriptor when a process connects. The default descriptor gives SYSTEM and Administrators full control and Authenticated Users the write right that connecting requires — so out of the box, any logged-on principal can submit, and an administrator narrows or widens that by changing the socket's descriptor, not by configuring peinit.
What limits an over-eager submitter is a quota: at most
MaxJobsPerSubmitter live jobs per submitting SID (default 64; SYSTEM is
exempt). A submission that would exceed it is refused with QUOTA_EXCEEDED
and creates nothing. A job stops counting the moment it ends.
What a job runs as #
A job submitted by svctl runs as your process's own primary token. There is
no CLI identity switch. A service can submit with a token it is authorized to
convey; the kernel checks that authority, and a token below Impersonation
level is refused with BAD_TOKEN. A job needing Delegation must be submitted
through a connection already at that level; it cannot be raised later.
The view records both the submitter and the identity the job runs as, plus its logon session. The TRM identity-conveyance reference describes attached tokens.
The definition #
Choose an absolute image path, its arguments and environment, a working directory, and any timeout or readiness settings. A submitted job has no restart policy, dependencies, health check, or trigger; use a service definition if you need those.
Submission returns once the job is running or has failed to start, not when it
has finished or signaled readiness. Use --wait to wait for completion or
job wait --for ready for a job configured with notify readiness. An accepted
submission can still fail at exec, for example because its identity cannot
execute the image.
See svctl job options for the CLI and the submission reference for complete fields and descriptor passing.
Who can manage a job #
Every job carries its own security descriptor from the moment it exists. By
default it is owned by the submitter and grants JOB_ALL_ACCESS to the
submitter, SYSTEM, and Administrators — and to nobody else. In particular the
job identity gets nothing: a process running as U cannot see or stop a job
that happens to run as U, unless the submitter's descriptor says so. A
submitter can supply its own descriptor (in SDDL) and peinit uses it exactly
as given — including a descriptor that locks the submitter out of its own job.
| Right | Grants |
|---|---|
JOB_QUERY | Read the job view; wait on it; see it in job list. |
JOB_STOP | Stop the job. |
JOB_SIGNAL | Send a signal to the job's main process. |
These rights govern both the jobs socket's own commands (status, wait,
stop, signal) and the control socket's job-status, job-list,
job-stop. As with services, job list filters rather than denies: you
see the jobs you hold JOB_QUERY on, while a command naming an existing job
you cannot query returns ACCESS_DENIED. UNKNOWN_JOB means the ID is
unknown or already discarded.
The job view #
svctl job status <id> reports the job's state and cause, submitter and
execution identity, PID, readiness, exit code or signal, and timestamps. Its
status text and progress are reported by the program itself; an absent value
does not establish that it is stuck.
The TRM job-view reference describes the progress message forms and update limits.
Stopping, timeouts, and the end of a job #
A job ends when its process exits, when its timeout elapses, when its
readiness_timeout elapses without READY=1, when someone stops it, or at
shutdown. A stop — whichever of those triggers it — is a service stop in
miniature: SIGTERM to the main process (skipped if the job already said
STOPPING=1), then after stop_timeout a SIGKILL of everything in the job's
cgroup, and if that survives, the job is Abandoned after the post-kill grace
with cause process_unkillable.
cause records why peinit ended a job, and is null when the process ended
of its own accord:
| Cause | Meaning |
|---|---|
parent_setup_failure | peinit could not prepare the launch — no token, no cgroup, no fork. No process existed. |
pre_exec_failure | Setup between fork and exec failed, or execve did. |
readiness_timeout | A notify job never sent READY=1 in time. |
timeout | The job ran longer than timeout. |
explicit_stop | A stop or job stop was issued. |
shutdown | The system was shutting down. |
process_unkillable | The process survived SIGKILL. |
State follows the exit, not the cause: a stopped job whose process handled
SIGTERM and exited 0 is **Completed with cause explicit_stop ** — peinit
asked, the process agreed, and both facts are recorded. One that died to the
signal is Failed with exit_signal set. A signal command is the raw
mechanism, by contrast: SIGKILL sent that way produces a Failed job with a
null cause, because peinit did not decide to end it.
A terminal job is retained for 60 seconds — long enough for a submitter
polling once a second to read the result — then dropped; after that its GUID
answers UNKNOWN_JOB, and the durable record is in
eventd.
Shutdown #
At shutdown, every live submitted job is
stopped at once, in no particular order — jobs have no dependencies, so
there is nothing to order — and a job still queued to launch is canceled with
cause shutdown. Shutdown does not complete while a live job remains,
bounded by the global ShutdownTimeout like everything else. Submissions
during shutdown are refused with INVALID_STATE.
Output #
A job's stdout and stderr are captured and forwarded to
eventd tagged with the job's
GUID, unconditionally — a submitter cannot turn that off. A submitter that
wants a live copy attaches one extra descriptor and sets output: true:
peinit then writes each line it reads to that output sink as well. The
copy is best-effort — a sink that is not being drained never slows the job or
peinit; lines that would block are dropped for the sink only while the
independent forwarding to eventd continues, and the drop is reported once per
job as a peinit.job.output.dropped event.
Submitted jobs bypass the operation model entirely — there is no service to "start," so the submission creates a job directly. The job is the whole lifecycle.
Where to start #
To create and poll operations from the command line, read Controlling services.
To understand the service states an operation drives a service through, read The service lifecycle.
To query the durable job and operation history, read Auditing.
Defining a Service
Peios / Using Peios / Services and Jobs
Use svctl definition or Services Manager to change a service's configuration. Both check field values before writing them. You need permission to change the service's registry key; permission to start or stop the service is separate.
Start by reading the current definition and runtime state:
A definition lives at Machine\System\Services\<name>. Its typed registry
values describe the program, identity, dependencies, triggers, and supervision
policy. The name of the key is the name you use in svctl.
Change and verify #
- Read the current definition. Decide which field needs to change and when it will apply.
- Use
svctl definition editor Edit definition… in Services Manager. Check the reported changes before restarting a running service. - Validate the saved definition with
svctl definition validate <service>. This checks fields; identity, privilege names, and dependency targets also need their runtime checks. - If launch settings require it, restart the
service during an
appropriate interruption window.
svctl reload-configre-reads definitions but does not replace a running process. - Run
svctl status <service>again. If it fails, inspect the cause and logs.
Creating and changing a definition #
A definition is a registry key, so reg can write one. Two tools also know
what each field means, and check a definition before writing it.
From a terminal: svctl definition #
def is short for definition.
- Fields go by their registry names, in any case.
- Values are given as text:
- a number as digits;
yesorno;- a choice by its name (
Type=Oneshot); - a list with one
--setfor each item, in order.
- A change is checked first, as peinit checks it. It goes through peinit's
own decoder, and every
timer:schedule is parsed. If peinit would reject it, nothing is written and you are told why. - Only the values that change are written, in one registry transaction. If one of them has changed since svctl read it, nothing is written.
- Values that are not fields are kept as they are.
editnames any changed fields that wait for a restart on a running service. See the mutability classes.
Some things can't be checked until later:
- privilege names, when the token is made;
- whether the services a definition names exist, when the graph is built;
- the identity, by authd.
svctl status after the change is the final word.
Manager #
In Services Manager, Edit definition… opens the selected service's definition in a window of its own. It's in the details pane and on each row's right-select menu. It reads Definition… when you can only read the definition. New service… on the bar defines a new one. A service's definition opens in one window at a time: while it is open, Edit definition… is unavailable for that service.
-
Every field is shown, by group. Each has its name in words with the registry name beside it, its default, and when a change takes effect.
-
What you type is checked when you leave the field, as peinit checks it. Anything wrong is said beside the field, and Save stays unavailable until it is put right.
-
Each timer's schedule says when it next comes round, under Triggers, in local time. A schedule that never comes round, such as
*-02-30, is marked as one that never starts the service. peinit takes such a definition and arms its other timers, so it does not stop you saving. These times are the schedule's, before any jitter. When the timer will really fire is in the details pane, once it is saved (see Controlling services). -
Save writes as svctl does, from the button or with Ctrl+S. Only the changes are written, in one transaction, and it is refused if someone else changed a value meanwhile. Revert reads the definition again. If the service is running, Save says which changes wait for a restart.
-
Delete… asks first. A running service carries on until it stops.
-
What you can do is asked of the registry:
- changing needs the right to set values on the service's key;
- defining a service needs the right to create keys under
Machine\System\Services; - deleting needs
DELETEon the key.
Without those rights, the definition is shown with every field fixed and the reason said.
-
Who can control the service (
ServiceSecurity) is changed with Who can control it…, not here. See Who can manage a service.
Field mutability: when a change takes effect #
Every field falls into one of four mutability classes. This table is the one to keep handy.
| Class | When a change takes effect | Fields |
|---|---|---|
| Immutable at runtime | Next restart only. | ImagePath, Type, Identity, RequiredPrivileges, ErrorControl, RemainAfterExit, and, while it is running, Triggers and Disabled |
| Apply on next start | Next start or explicit graph reload — not while running. | Requires, Wants, BindsTo, Conflicts, OnFailure, Conditions, Asserts |
| Hot-reloaded | Next relevant event, no restart. | ServiceSecurity (next control request) |
| Reloadable at runtime | Next relevant operation (start, health-check cycle, …). Launch settings apply to the next process, not the current one. | Arguments, SuccessExitCodes, all timeout/retry values, the health-check fields, RestartPolicy, Environment, WorkingDirectory, the hooks and HookIdentity, Readiness, NotifyAccess, LimitNOFILE/LimitCORE, FdStoreMax, TTYPath/TTYPrecedence, RuntimeDirectories, Provides, TimerPersistent/TimerJitter, SafeMode, DisplayName, Description |
On a service that is not running, Triggers and Disabled take effect as
soon as peinit has read the change: that is what arms a timer added to an
inactive service.
The practical reading: changing what a process is or runs as (ImagePath,
Identity, Type, privileges, ErrorControl) is fundamental enough that
it only applies when a fresh process starts — you must restart. Changing
policy that peinit consults each time it acts (timeouts, restart behavior,
health checks) is picked up the next time peinit acts. And ServiceSecurity
is special: it is re-read on every control request, so an access-control
change takes effect on the very next command without touching the running
service.
Environment, Arguments, WorkingDirectory, and process limits do not
alter an already-running process. Even though peinit can reload those fields,
the process receives them only on its next start.
For inactive services the rules are simpler, because there is no running process to protect: a new service entry becomes available once the change notification is processed; a changed timer arms on the next evaluation; a changed dependency takes effect on the next start.
Removing a service definition #
Use svctl definition delete web only when you intend to remove the
definition of web. To stop its current work, use svctl stop web instead.
Deleting a definition from the registry does not kill a running instance. peinit learns of the removal through the same notification path and behaves according to whether the service is running:
- Not running (Inactive, Failed, Completed, Skipped, Abandoned, Backoff): peinit discards the in-memory entry immediately. There is nothing to supervise.
- Running (Active, Starting, Reloading, Stopping): the running process is a job, and a job outlives its definition. peinit marks the entry definition-removed, keeps the cached definition only to finish supervising the existing instance, and does not restart it when it exits. Once it exits, the entry — and any stored fds — are discarded.
A removal that leaves a dangling hard dependency does not apply: peinit
refuses the configuration read with MissingHardDependency. Remove or update
the dependent definitions first. A definition-removed entry therefore has no
dependents.
For a definition-removed entry, stop still works so you can drain it
cleanly, but start, restart, and reload are rejected with
UNKNOWN_SERVICE — there is no definition to start from. A status query
reports it with a definition_removed: true flag so the draining instance is
never invisible.
Service names #
A service name must be made of characters from [A-Za-z0-9._-] and be 1–128
bytes long. Anything else is a validation error. Two characters are pointedly
excluded:
/— names map directly onto cgroup ids and registry key names, and a slash would be ambiguous in both.:— reserved for peinit-internal synthetic names (for example, the way a hook job is labeled).
The name is how you refer to the service everywhere: in svctl commands, in
another service's dependency list, in a
ServiceSecurity
descriptor, and in the per-service
SID derived from it.
The definition schema #
A definition is a set of typed registry values. Rather than list all of them
in one wall of rows, the tables below group the fields by what they are for,
with a pointer to the page that explains each group in depth. Every field is
optional unless noted; the only hard requirement is ImagePath. The full
type-and-default catalog lives in the Registry key
reference.
What to run — the binary and its execution context.
| Field | Default | Purpose |
|---|---|---|
ImagePath (required) | — | Absolute path to the service binary. |
Arguments | — | Argument list passed to the binary. |
WorkingDirectory | / | Working directory for the process. |
Environment | — | KEY=VALUE pairs added to the environment. |
RuntimeDirectories | — | Private directories created under /run immediately before the process starts. See The execution environment. |
LimitNOFILE, LimitCORE | — | RLIMIT_NOFILE / RLIMIT_CORE. |
What kind of service — type and readiness. See Simple and Oneshot services.
| Field | Default | Purpose |
|---|---|---|
Type | Simple | Simple (long-running) or Oneshot (run-to-completion). |
Readiness | Notify | Notify (READY=1 through sd_notify) or Alive (ready when the process exists). Ignored for Oneshot. |
RemainAfterExit | 0 | Oneshot only — stay in Completed after a successful exit. |
SuccessExitCodes | — | Non-zero exit codes to treat as success. |
When to start — triggers and conditions. See Triggers and timers.
| Field | Default | Purpose |
|---|---|---|
Triggers | — | boot, boot:settled, timer:<schedule>, tty:released. Absent = demand-only. |
Disabled | 0 | If 1, triggers must not activate the service (manual start still allowed). |
SafeMode | 0 | Eligible within the boot-triggered set in Safe mode; does not add a boot trigger. |
Conditions, Asserts | — | Start-time checks. A failed condition skips; a failed assert fails. |
Who it runs as — identity and privileges. See Service identity and privileges.
| Field | Default | Purpose |
|---|---|---|
Identity | LocalService | Principal name, SID, or Service for a distinct virtual service account. |
RequiredPrivileges | — | Privilege allow-list; everything else is stripped from the token. |
HookIdentity | service's Identity | Identity for ExecStartPre/ExecStartPost hooks. |
How it relates to other services — dependencies. See Dependencies and ordering.
| Field | Purpose |
|---|---|
Requires | Hard dependencies — must be satisfied first; their failure fails this service. |
Wants | Soft dependencies — attempted first if present and enabled, but their failure does not block this service. |
BindsTo | Runtime coupling — if the target stops, this stops too. |
Conflicts | Mutual exclusion — starting this stops the named services. |
OnFailure | Service to start when this one enters Failed. |
How it is kept alive — supervision and health. See Keeping services running.
| Field | Default | Purpose |
|---|---|---|
ErrorControl | Normal | Normal (stay Failed) or Critical (sync + reboot on irrecoverable failure). |
RestartPolicy | OnFailure | Never / OnFailure / Always. |
RestartMaxRetries, RestartWindow, RestartDelay | 5 / 120 / 1 | Restart budget, the window of health that resets it, and the backoff base. |
HealthCheck, HealthCheckInterval, HealthCheckTimeout, HealthCheckRetries | — / 30 / 5 / 3 | Active health-check command and its timing. |
WatchdogTimeout | 0 | Expected interval between WATCHDOG=1 pings; 0 disables. |
The transition phases — hooks and timeouts. See The execution environment and The service lifecycle.
| Field | Default | Purpose |
|---|---|---|
ExecStartPre, ExecStartPost | — | Commands run before the binary / after readiness. |
ExecReload | (SIGHUP) | Reload command or signal:<NAME>. |
StartTimeout, StopTimeout | 30 / 10 | Seconds for the whole start sequence / between SIGTERM and SIGKILL. |
The remaining knobs — scheduling, notify, fds, metadata.
| Field | Default | Purpose |
|---|---|---|
TimerPersistent, TimerJitter | 1 / 0 | Catch up missed timer runs after reboot / random delay per firing. |
NotifyAccess | Main | Who can send sd_notify messages (only Main is supported). |
FdStoreMax | 0 | Size of the per-service fd store; 0 disables it. |
ServiceSecurity | inherit | Security descriptor controlling who can manage the service. |
DisplayName, Description | — | Human-readable labels for status output. |
Forward compatibility #
The schema version lives at Machine\System\Services\SchemaVersion (
1). peinit is deliberately forward-compatible:
- Unknown values are ignored. A definition written for a newer peinit does not break an older one.
- A newer schema version does not block boot. peinit logs a warning and continues.
- The schema only grows. New capability arrives as new optional fields, never as a breaking change to an existing one.
One defensive rule cuts the other way: a known field must not appear more than once in a collected definition. A duplicated known field is a validation error, even though the registry would ordinarily give you at most one value per name.
peinit works from a snapshot, not the live registry #
Here is the idea that explains most surprises. peinit does not re-read the registry every time it touches a service. It reads definitions at well-defined moments and operates on an in-memory model in between.
Two layers of snapshotting stack on top of each other:
- Boot generation. At the start of boot, peinit reads all definitions, builds the dependency graph, and validates it. The whole boot runs against that one snapshot. Changes made during boot — by an install script, a post-hook — do not perturb the boot in progress.
- Activation generation. When peinit starts a specific service, it
snapshots that service's definition for the entire start. Pre-exec hooks,
the token request, the readiness timeout, the first health checks — all use
the values captured at activation. Edit a field while the service is
Starting, and the edit waits for the next start.
peinit learns about registry edits through change
notifications: it subscribes to
Machine\System\Services\ and Machine\System\Init\ at boot, and processes
events in its event loop at a time of its choosing. If the notification queue
overflows — a bulk admin operation, a flurry of scripted writes — peinit
detects the overflow marker and does a full reload-config to resynchronise.
You never have to think about the queue; you do have to know that a change is
picked up, not pushed, and that when it takes effect depends on the field.
Where to start #
To understand the Type and Readiness fields and the Simple/Oneshot split,
read Simple and Oneshot services.
To understand how a definition becomes a running, supervised process — and
what each state in a status output means — read The service
lifecycle.
For the complete type-and-default catalog of every registry key peinit reads, see the Registry key reference.
Simple and Oneshot Services
Peios / Using Peios / Services and Jobs
Choose Simple for a program that stays running and Oneshot for a task
that should finish. Then check how it reports success: a Simple service
becomes ready through Notify or Alive; a Oneshot succeeds by exiting
successfully.
The default is Type=Simple with Readiness=Notify. Before starting a new
definition, make sure the program can send READY=1 from its main process. A
program that never sends it will time out even if its process is alive. Keep
daemons in the foreground; peinit does not follow a double-forked replacement
process.
Oneshot #
| Simple | Oneshot | |
|---|---|---|
| Process lifetime | Long-running; is the service | Runs once, exits |
| Readiness | Notify (READY=1) or Alive | Successful exit — Readiness ignored |
| Satisfies dependents when | Active | Completed (with or without RemainAfterExit) |
| Successful end state | Active (until stopped) | Completed, then Inactive (unless RemainAfterExit=1) |
ExecStartPost fires | After readiness | After successful exit only |
StartTimeout covers | Startup until readiness | The whole execution |
| Watchdog and health checks | Supervised while Active | None — WatchdogTimeout/HealthCheck are inert |
| Restart on success | n/a | Never (use a timer to re-run) |
Simple services #
A Simple service is a long-running daemon. peinit forks, installs the
token, and execs the
binary. The process is the service: while it runs, the service is running;
when it exits, the service has stopped. This is the default and covers the
large majority of services — registryd, authd, sshd, application
daemons.
The interesting question for a Simple service is when does it count as
started — the moment its dependents
are allowed to begin. That is the readiness model, set by the Readiness
field.
Alive #
| Readiness | Ready when… | Use for |
|---|---|---|
| Notify (default) | The service sends READY=1 through sd_notify. | Any service that has meaningful startup work — opening a socket, loading state, connecting to a backend. The dependent genuinely should wait. |
| Alive | The process exists — readiness is immediate. | Services with no startup handshake, where "the process is up" is as good a signal as you will get. |
The distinction matters because it is a promise to dependents. With
Notify, a service that declares itself a Requires target is telling
peinit "do not start anything that needs me until I say READY=1." With
Alive, peinit can only promise that the process was forked — not that it
is functional.
Once ready, a Simple service transitions to Active and stays there until its process exits or it is stopped. What happens on exit — clean exit, crash, restart — is the subject of The service lifecycle and Keeping services running.
Oneshot services #
A Oneshot service is a run-to-completion task. peinit forks, installs the token, execs the binary, and waits for it to exit. It is the right type for setup work: creating directories, initializing a database, running a schema migration, applying a one-time fixup at boot.
For a Oneshot, readiness is exit, not a signal. The Readiness field is
ignored entirely — READY=1 is meaningless for a process whose whole job is
to finish. Success and failure are decided by the exit code:
- Exit 0 (or any code listed in
SuccessExitCodes) → the service succeeded. - Any other exit, or death by signal → the service failed, and the failure policy applies.
SuccessExitCodes is for binaries that signal a meaningful outcome with a
non-zero code — for example, a tool that exits 2 to mean "nothing to do."
Each entry is a decimal 0 –255; code 0 is always success and need not be
listed.
Completed, and RemainAfterExit #
A successful Oneshot transitions to Completed, and what happens next
depends on RemainAfterExit:
RemainAfterExit | After a successful exit |
|---|---|
| 0 (default) | The service passes through Completed — releasing its dependents — then transitions to Inactive. |
| 1 | The service stays in Completed. |
Both forms satisfy dependents; the only difference is what a later status
query shows. Use RemainAfterExit=1 when "this task is done" is a state worth
seeing — a boot-time migration you want to confirm ran, say — rather than a
service that quietly returns to Inactive.
Oneshot timing and hooks #
Two details distinguish a Oneshot's start sequence from a Simple one:
StartTimeoutcovers the entire run. For a Simple service the timeout covers startup until readiness; for a Oneshot it covers everything from the first pre-hook to process exit. A long-running Oneshot must raiseStartTimeoutaccordingly (or sendEXTEND_TIMEOUT_USECas it works — see Keeping services running).ExecStartPostruns only on success. Post-hooks fire after the successful exit. If the Oneshot fails,ExecStartPostdoes not run.
Oneshot #
A Oneshot is not restarted on success, regardless of RestartPolicy — even
Always. A successful exit is the goal, not a failure to retry.
RestartPolicy governs only the response to failure (a non-zero exit). To
re-run a Oneshot on a schedule, give it a timer
trigger; that is the intended
mechanism.
No forking daemons #
peinit does not support services that double-fork to background
themselves. The whole reason a traditional daemon double-forks — to detach
from the launcher — is moot when the launcher tracks the process it spawned.
peinit obtains a pidfd for every process at fork time, which is a kernel
handle to that exact process, immune to PID-reuse races. There is no
MAINPID= mechanism for a service to redirect supervision onto a different
process; peinit supervises what it forked.
If a legacy binary insists on daemonising, the fix lives at the
package build — wrap it so it stays in the
foreground (commonly a --no-daemon /--foreground flag) — not at the init
layer.
The sd_notify contract #
A Notify-readiness service signals readiness by sending READY=1 over the
sd_notify protocol — a datagram to the socket named in the NOTIFY_SOCKET
environment variable, which peinit sets for every service. READY=1 is only
the most visible message; the same channel carries watchdog keepalives
(WATCHDOG=1), graceful-stop notice (STOPPING=1), timeout extensions
(EXTEND_TIMEOUT_USEC), status strings (STATUS=), and the fd store. These
are covered where they belong — readiness here, the rest in Keeping services
running and Controlling
services.
Readiness is always per start generation. A READY=1 left over from a
previous incarnation of the process is never valid for the current start —
peinit ties every notify message to the specific process it is
supervising, verified by pidfd.
Who is allowed to send these messages is governed by NotifyAccess, which
has a single value: Main (0, the default). Under Main, only
the tracked main PID — the process peinit forked and supervises — is
authorized to send sd_notify readiness and status messages; a message arriving
from any other PID (a child, a helper, an unrelated process) is ignored. So if
a worker your service spawns sends READY=1, peinit will not act on it — the
readiness signal must come from the main process itself.
Where to start #
To control when either type of service starts, read Triggers and timers.
To follow a service from definition to running process and read its states, read The service lifecycle.
To configure restart, health checks, and watchdogs for a Simple service, read Keeping services running.
Triggers and Timers
Peios / Using Peios / Services and Jobs
To see when a scheduled service will run, use svctl status <service> or the
Next run column in Services Manager. To change automatic starts, edit the
definition's Triggers field. A saved schedule is not evidence that a timer
is armed; check status after saving it.
A trigger decides when the service starts on its own. It is independent of
service type: boot and timer
triggers can start either Simple or Oneshot services. Each entry in Triggers
is written type or type:argument.
| Trigger | Form | Meaning |
|---|---|---|
| Boot | boot | Start during Phase 2, in dependency order. |
| Settled boot | boot:settled | Start after the boot set settles, with a bounded wait; useful for console prompts. |
| Terminal handover | tty:released | Start when the terminal named in TTYPath is released. |
| Timer | timer:<schedule> | Start on a calendar schedule. |
Without triggers, the service is demand-only: it starts through a control command or because another service needs it. To prevent automatic activation while keeping manual start, use Disabled.
Seeing when a timer runs #
peinit reports each timer as it has it armed, in the service's status:
- the schedule's next occurrence;
- when the timer will actually fire, with its jitter added;
- when it last fired.
A schedule peinit refused, such as *-02-30, which never comes round, is
reported with the reason, rather than left out.
$ svctl status logrotate
...
timers:
*-*-* 02:00:00
next: 2026-06-02T02:00:00Z, firing at 2026-06-02T02:07:12Z after jitter
last fired: 2026-06-01T02:03:40Z
svctl list has a NEXT TIMER column, with each service's soonest firing.
On the desktop, Services Manager shows the same things in local time: a Next
run column, and each timer in the details pane. See Controlling
services for
the fields.
These times are peinit's own. Jitter is drawn at random each time a timer is armed, so the time a timer fires can't be worked out from its definition.
Disabled #
Disabled=1 suppresses automatic activation. A disabled service will not
be started by any trigger — boot, timer, terminal handover, or anything
added later — but it can still be started by hand through the control
interface. It is the switch for "configured, but not running on its own right
now."
Two related controls are easy to confuse with it:
| To… | Use |
|---|---|
| Stop a service from auto-starting, but keep manual start | Disabled=1 |
| Stop a service from being started at all, even manually | Deny SERVICE_START in its ServiceSecurity descriptor |
| Stop a running service | The stop command |
Enabling and disabling are registry writes performed by admin tooling, not
peinit commands. peinit picks up a Disabled change through a registry
notification or on reload-config. A
disabled service's definition is still loaded into peinit's model, so it is
ready for an on-demand start the instant you ask.
Calendar expressions #
Timer schedules are written in systemd's OnCalendar format. peinit's grammar
is normative and self-contained — what follows is the whole language. The
general shape is:
DayOfWeek Year-Month-Day Hour:Minute:Second Timezone
Every field is optional and has a default, so most real schedules are short.
| Field | Form | If omitted |
|---|---|---|
| DayOfWeek | weekday name(s) | any day (*) |
| Date | Year-Month-Day | *-*-* (any date) |
| Time | Hour:Minute:Second | 00:00:00 |
| Second | the :Second of Time | :00 |
| Timezone | IANA zone name | system-local time |
So 02:00:00 is a complete expression — date defaults to every day, and it
means "every day at 02:00." Hour:Minute with no seconds defaults the seconds
to 00.
Component syntax #
Each numeric component — year, month, day, hour, minute, second — and the weekday accept the same operators:
| Operator | Example | Matches |
|---|---|---|
| Wildcard | * | any value |
| List | 1,15 | any listed value |
| Range | Mon..Fri, 8..17 | the inclusive range |
| Repetition | 0/15 | 0, then every multiple of the step — 0, 15, 30, 45 |
| Range + step | 8..17/2 | 8, 10, 12, … up to and including 17 |
Weekdays are English names, case-insensitive, abbreviated (Mon) or full
(Monday), and take lists and ranges.
Last day of the month #
A ~ in place of the - between Month and Day counts the day from the
end of the month: ~01 is the last day, ~02 the second-to-last, and so
on. So *-*~01 is the last day of every month. Repetition combines with it —
Mon *-05~07/1 is "the last Monday in May."
Named shortcuts #
These stand in for the expression shown:
| Shortcut | Equivalent |
|---|---|
minutely | *-*-* *:*:00 |
hourly | *-*-* *:00:00 |
daily | *-*-* 00:00:00 |
weekly | Mon *-*-* 00:00:00 |
monthly | *-*-01 00:00:00 |
quarterly | *-01,04,07,10-01 00:00:00 |
semiannually | *-01,07-01 00:00:00 |
yearly / annually | *-01-01 00:00:00 |
Timezones and precision #
A timezone specifier follows the IANA database — Europe/London,
US/Eastern, UTC. With none, the expression is interpreted in
system-local time.
Precision is second-level. Unlike systemd, peinit does not accept sub-second fractions; a fractional second is a parse error. Service scheduling has no use for finer granularity.
Examples #
| Expression | Meaning |
|---|---|
*-*-* 02:00:00 | Every day at 2 am (system-local) |
Mon *-*-* 00:00:00 | Every Monday at midnight |
*-*-1,15 12:00:00 | 1st and 15th of each month at noon |
*-*~01 00:00:00 | Last day of each month at midnight |
Mon..Fri *-*-* 09:00:00 | Weekdays at 9 am |
*-*-* *:00/15:00 | Every 15 minutes |
*-*-* 02:00:00 Europe/London | Every day at 2 am London time |
What happens when a timer fires #
A timer firing does not blindly start the service — peinit considers the service's current state first, so a firing never collides with a run already in progress.
| Type | Current state | Action |
|---|---|---|
| Oneshot | Inactive / Completed / Failed | Start it (operation source Timer). |
| Oneshot | Active / Starting | Set a single pending flag — one catch-up run when the current one finishes. |
| Simple | Inactive / Failed | Start it. |
| Simple | Active / Starting | No-op; the firing is logged. |
The Oneshot "pending" flag is deliberately not a queue: many firings that land while a Oneshot is busy collapse into one catch-up run, taken when the current run ends. A service cannot stampede itself.
That single flag is shared across all of a Oneshot's timers, not one per timer. If a Oneshot has several timer triggers and two of them fire while it is busy, at most one run is still pending when the current one finishes. The timers are otherwise fully independent — each keeps its own next-firing time and its own last-run timestamp — but they can only ever queue up a single shared catch-up between them.
Each timer firing creates a normal start operation, so a timer-started service is observable exactly like an admin-started one — same GUIDs, same events.
Persistent timers and catch-up #
TimerPersistent (default 1) controls whether runs missed while the
machine was off are caught up after a reboot.
peinit records the last-run timestamp of each timer in the registry. On boot, for each persistent timer it reads that timestamp, computes the next firing after it, and — if that time is already in the past — fires once, immediately, then resumes the normal schedule.
The catch-up is always a single run, never one-per-missed-occurrence. A
daily timer that was off for five days fires once on the next boot, not five
times. A non-persistent timer (TimerPersistent=0) ignores history entirely
and computes its next future firing from now.
One subtlety worth knowing: the last-run timestamp is keyed by the schedule string. If you change a timer's schedule, the old timestamp is orphaned and the new schedule has no history, which causes exactly one spurious catch-up run. Schedule changes are rare and the cost is one extra run, so peinit accepts it rather than tracking trigger identity.
Jitter #
TimerJitter (default 0) adds a random delay of 0 to TimerJitter seconds
to each firing, recomputed every time. A timer scheduled for midnight with
TimerJitter=900 fires at a slightly different moment between 00:00 and 00:15
each day. Jitter only ever delays — a timer never fires before its scheduled
time. It is the standard remedy for a fleet of machines all hammering the same
backend at exactly midnight.
When the clock jumps #
Calendar timers are wall-clock schedules: *-*-* 02:00:00 means "02:00 on
the wall," not "every 86,400 seconds." peinit arms them as absolute real-time
timers that are canceled and recomputed whenever the system clock is stepped,
so the schedule stays anchored to the wall clock across corrections.
| Event | Behavior |
|---|---|
| NTP step or manual clock set | Armed calendar timers are canceled and recomputed against the new wall clock. A backward step pushes the next firing later; a forward step that crosses a missed time fires it once. |
| Suspend / resume | A scheduled time that elapsed while suspended fires once on resume — once, not once per missed occurrence. |
| A missed occurrence within one uptime | Fire once, then resume the normal schedule. peinit never replays every occurrence in the gap. |
| Daylight-saving transition (timezone-aware timer only) | A scheduled time in the skipped hour never fires; a scheduled time in the repeated hour fires once. See below. |
Daylight-saving is the case most likely to surprise you, and it only affects
timers that name an IANA zone that observes DST (a bare 02:30:00 in
system-local time follows whatever the system does). For a scheduled local
time inside the affected hour:
- Spring forward — that time does not exist on the transition day. The timer does not fire for that occurrence; it resumes at the next valid occurrence.
- Fall back — that time occurs twice. The timer fires exactly once, on the first occurrence.
This is distinct from peinit's interval timers — the watchdog, health-check intervals, restart backoff, and the start/stop/reload phase timeouts. Those are genuine durations measured on the monotonic clock, so "wait 30 seconds" means 30 elapsed seconds and never lurches when the wall clock is set.
There is one boot-time case worth calling out on its own. When peinit reads a timer's stored last-run timestamp at boot and finds it is in the future relative to the current wall clock — meaning the clock has gone backwards since that run — it can't trust the timestamp, so it treats the timer as having an unknown last run and fires the persistent catch-up immediately. This only applies to the boot-time check; the runtime handling above is unaffected.
Waiting for the boot to settle #
boot:settled is boot with one difference: the service starts once the
Phase 2 boot set has stopped moving — every service in it reached a state it
will not leave on its own — rather than during it.
It exists for services that write to a terminal. peinit reports its progress
to /dev/console, and a service holding that same terminal writes there too,
so a prompt started mid-boot gets written over: login emits Username:
with no newline and waits, peinit appends a service line, and the result is
unreadable until you press Enter and the login program redraws.
The wait is capped (Machine\System\Boot\SettleTimeout, 5 seconds by
default). A service stuck in Starting therefore costs a deferred service a
short delay rather than preventing it — which matters most exactly when
something is broken and a console prompt is what you need.
A boot:settled service is deliberately not part of the boot plan. It
does not consume the parallel-start
budget, is not counted toward
boot success, and cannot block another service. Waiting for quiet is a
preference; it must not change what the boot means.
Queueing for a terminal #
A terminal has one owner at a time. Two services writing to the same TTYPath
do not fail — they interleave, which on a console means a sign-in prompt with
a
progress line through the middle of it. So peinit gives the device to one of
them and skips the rest, and tty:released is how the ones that were skipped
get their turn.
The whole arrangement is three fields. A first-boot setup flow and a sign-in prompt, both on the console:
| Service | TTYPath | TTYPrecedence | Triggers |
|---|---|---|---|
oobe | /dev/console | 100 | boot:settled |
login-console | /dev/console | (0) | boot:settled, tty:released |
On a first boot both are deferred, oobe outranks the sign-in prompt on
TTYPrecedence, so oobe takes the console and login-console is
skipped with cause TtyUnavailable. When oobe finishes — or crashes,
or is stopped; all three free the device — tty:released starts the sign-in
prompt. On every later boot oobe is gone, nothing is holding the console,
and the sign-in prompt starts straight away.
A few rules worth knowing:
- Higher
TTYPrecedencewins, and equal precedence breaks on service name, so the outcome is the same on every boot. The default is 0. - Nobody is preempted. Precedence decides between services starting at the same moment; a service already using a terminal keeps it.
- A service that stops is not offered its own terminal back. Relaunching
it is
RestartPolicy's job, not this. - Both fields need a
TTYPath.tty:releasedorTTYPrecedencewithout one is rejected when the definition is read, rather than quietly doing nothing. tty:releasedon its own starts nothing until somebody takes the terminal and lets it go. Give a service that must come up either way abootorboot:settledtrigger as well, aslogin-consolehas above — otherwise a machine with nooobeinstalled never gets a sign-in prompt.
Being skipped is not a failure: a skipped service satisfies anything that
depends on it, exactly as a service skipped by a Conditions entry does.
You can list more than one trigger, including more than one of the same type.
["timer:*-*-* 02:00:00", "timer:*-*-* 14:00:00"] runs at 2 am and 2 pm. The
model is built to grow — future trigger types (path, device, event) will slot
into the same list without a schema change.
Where to start #
To see how a timer-started run appears as a job and an operation, read Jobs and operations.
To understand the states a timer-started service moves through, read The service lifecycle.
For the exact registry keys that store last-run timestamps, see the Registry key reference.
Keeping Services Running
Peios / Using Peios / Services and Jobs
When a service keeps restarting, check its state, cause, and
logs before changing the
restart policy. Backoff means peinit is waiting to retry; Failed with
RestartBudgetExhausted means the retry budget ran out.
Use the policy reference below to distinguish a program failure from a failing health check or watchdog. Preserve the underlying error while you investigate. Increasing a timeout or retry count can change when the failure appears without fixing it.
Restart policy #
When a service fails in a way that might be transient, peinit consults
RestartPolicy:
| Policy | Value | Behavior |
|---|---|---|
| Never | 0 | Never restart. The service goes straight to Failed. |
| OnFailure (default) | 1 | Restart on a crash or runtime failure. An exit code in SuccessExitCodes is not a failure and is not restarted. |
| Always | 2 | Restart on any failure, and — for a Simple service — restart even a successful clean exit (see clean exits). |
Not every failure is restart-eligible. peinit splits causes into three groups:
- Restart-eligible — peinit consults the policy and budget:
ProcessCrash,WatchdogTimeout,HealthCheckFailure,ReadinessTimeout,PreHookFailure,PreExecFailure,ParentSetupFailure. (The startup failures are eligible on purpose — a pre-hook that failed on a momentarily-missing mount deserves another try.) - Never restarted — retrying cannot help: an explicit stop or reset,
shutdown, conflict eviction, a broken definition (
ValidationError,CycleDetected,DependencyFailure,AssertionError), an already-exhausted budget, or an unkillable process. - Budget-exempt —
BindsToRecovery, where a bound service came back and its dependents are revived. The dependent did not fail on its own, so this restart does not count against its budget.
The budget and backoff #
Restarting an instantly-crashing service in a tight loop is worse than useless, so every restart is throttled by two mechanisms working together.
Exponential backoff. Before each restart the service sits in the
Backoff state for a delay
that doubles on each consecutive failure, starting from RestartDelay
(default 1 s) and capped at 60 s. So a crash-looping service backs off 1 s, 2
s, 4 s, 8 s, … up to a minute between attempts.
The budget. A consecutive-failure counter tracks how many times the
service has failed in a row. Once it reaches RestartMaxRetries (default 5),
the next failure is not restarted: the service transitions to Failed with
cause RestartBudgetExhausted.
The reset. The counter resets to zero once the service stays Active for
RestartWindow seconds (default 120) without failing. This is the crucial
detail: the budget is not "N restarts ever" — it is "N restarts faster
than the service can sustain RestartWindow of health." A service that
crashes once a day and recovers cleanly each time never exhausts its budget,
because every crash starts from a counter of zero. Only failures recurring
faster than the service can stay healthy accumulate.
flowchart LR
A["Active"] -->|crash| B{"budget left?"}
B -->|yes| C["Backoff<br/>delay doubles"]
C -->|delay elapsed| D["Starting"]
D -->|ready, stays Active<br/>RestartWindow| A
B -->|no| E["Failed<br/>RestartBudgetExhausted"]
Clean exits #
For a Simple service, exiting with code 0 (or a SuccessExitCodes match)
is success, not a crash — a daemon chose to quit. What peinit does next
depends on the policy:
- Under
NeverorOnFailure, the cause isCleanExitand the service goes straight to Inactive, with no restart-policy consultation at all. - Under
Always, the cause isCleanExitRestartand the service is restarted — but through the same backoff and budget as a failure, so a daemon that exits cleanly in a tight loop cannot bypass throttling. Logs and status make clear it exited successfully and was restarted only because the policy is Always.
A terminal-attached Simple service is an exception: a successful exit with
RestartPolicy=Always is treated as a normal logout. It resets the failure
counter and restarts at the base delay, capped at 60 seconds, without using
the crash budget. Failures still use the ordinary budget.
(A Oneshot clean exit is never restart-eligible regardless of policy — see service types.)
Health checks #
A live process is not always a working one — it can lose its database connection, wedge in a bad state, or return errors while still "up." An active health check closes that gap by running a command periodically and treating its exit code as a verdict: 0 is healthy, non-zero is a failure.
Health checks apply to Simple services only. peinit starts a service's
health-check timer once the service becomes Active; a
Oneshot has no long-running process
to probe, so it never has one. HealthCheck and its companion fields are
inert on a Oneshot — no timer is started — so don't set them there expecting
supervision.
| Field | Default | Controls |
|---|---|---|
HealthCheck | — | The command to run (runs under the service's own token). |
HealthCheckInterval | 30 | Seconds between runs. |
HealthCheckTimeout | 5 | Seconds before a check is killed and counted as failed. |
HealthCheckRetries | 3 | Consecutive failures before the service is declared unhealthy. |
HealthCheckRetries consecutive failures mark the service unhealthy and
restart it through the normal restart policy — backoff and budget included. A
single success resets the failure count. If a check is still running when the
next interval fires, the new one is skipped rather than stacked.
The health field in a status response reflects this: healthy,
unhealthy (failing but not yet failed out), unknown (configured, no result
yet), or null (no health check).
The flap guardrail. Health-check throttling only works if a failure cycle is shorter than the restart window — otherwise the counter resets between failures and the service restarts forever. peinit enforces this at validation time as a hard rule:
HealthCheckRetries × HealthCheckInterval < RestartWindow
A definition that violates it is a validation error, not a warning — the
service is marked Failed with ValidationError rather than allowed to restart
indefinitely.
A health check stuck in D-state is handled like any other stuck helper: its sub-cgroup is leaked and surfaced as a warning, but — unlike a stuck main process — it does not push the service to Abandoned. A health check holds no service resources; it is only a probe.
The watchdog #
The watchdog inverts the health check: instead of peinit asking the service if
it is alive, the service must periodically tell peinit. Set WatchdogTimeout
(seconds; 0 disables) and the service must send WATCHDOG=1 through
sd_notify at
least that often. Miss the deadline and peinit treats it as a failure (cause
WatchdogTimeout) and applies the restart policy.
Like health checks, the watchdog is a Simple-only supervision mechanism.
peinit arms the watchdog timer only once a Simple service becomes Active; on a
Oneshot WatchdogTimeout is inert —
no timer is started, and setting it changes nothing.
A service can adjust its own watchdog at runtime by sending
WATCHDOG_USEC=<microseconds>: a positive value re-arms the timer with the
new interval immediately; 0 disables the watchdog. This is for services
whose phases have different latencies — a database might run a tight 5 s
watchdog normally but widen it to 60 s during a compaction pass, because it
knows its own phases better than the schema author did. The runtime value does
not persist: a restart reverts to the schema's WatchdogTimeout.
Timeout extension #
A service that does genuinely slow work during a transition can ask for more
time by sending EXTEND_TIMEOUT_USEC=<microseconds> while it is Starting,
Stopping, or Reloading. Each message replaces the current phase deadline (it
is not additive); a service that keeps sending them keeps proving it is making
progress, and if it stops, the last deadline fires and peinit escalates
normally.
The extension is capped to prevent a buggy service from extending forever:
| Phase | Base timeout | Maximum deadline |
|---|---|---|
| Starting | StartTimeout | StartTimeout × 4 |
| Stopping | StopTimeout | StopTimeout × 4 |
| Reloading | StartTimeout | StartTimeout × 4 |
During shutdown a second, global cap also applies — the deadline can never exceed the remaining time in the global shutdown timeout, and the stricter of the two caps wins. A message received outside a transition (the service is Active, Failed, …) is ignored — there is no timeout to extend.
OnFailure #
When a service enters Failed, an OnFailure field names another service
to start in response — a fallback for graceful degradation (the main web UI
failed; bring up a minimal emergency endpoint). It is not a monitoring or
alerting hook; that is eventd's job.
OnFailure fires for runtime failures — ProcessCrash, WatchdogTimeout,
HealthCheckFailure, the startup-failure causes, and non-Critical budget
exhaustion. It deliberately does not fire for:
ShutdownWave— nothing new starts during shutdown.- **
ValidationError,CycleDetected,DependencyFailure,AssertionError** — these are definition or graph breakage, not a running service degrading. The fallback would likely sit in the same broken graph anyway.
Because a fallback can itself fail and carry its own OnFailure, peinit
bounds the chain: it tracks which services it has already started for one
originating failure, refuses to start one twice, and never follows the chain
beyond a depth of 16. When the guard trips, it logs the loop and stops.
ErrorControl: when failure is not an option #
ErrorControl decides how serious an irrecoverable failure is:
| Level | Value | On irrecoverable failure |
|---|---|---|
| Normal (default) | 0 | The service stays in Failed. The rest of the system carries on. |
| Critical | 1 | peinit syncs filesystems and reboots immediately. |
A Critical service is one the system genuinely cannot run without — the
platform daemons registryd, authd, lpsd, eventd are all Critical.
"Irrecoverable" means the restart budget was exhausted: peinit tried, backed
off, retried up to RestartMaxRetries, and the service still would not stay
healthy. At that point the fastest path to a known-good system is a reboot.
A few consequences worth holding onto:
- Critical failure outranks
OnFailure. When a Critical service exhausts its budget, peinit reboots; it does not start theOnFailurehandler. ErrorControl=CriticalimpliesSafeMode. A Critical service is always eligible to start in Safe mode.- Critical services are OOM-protected. peinit sets their
oom_score_adjto-1000, so the kernel will not pick them as out-of-memory victims. - A runtime Critical crash does not enter Safe mode — it follows the reboot path. Safe mode is only for boot-time configuration errors (a cycle or conflict involving a Critical service). The escalation between reboots, the boot-attempt counter, and Recovery mode are covered in Boot and boot modes.
Where to start #
To see exactly which states these policies move a service through, read The service lifecycle.
To understand how a failed service propagates to the ones that depend on it, read Dependencies and ordering.
When a service will not stay up, work backward from the symptom in Troubleshooting peinit.
Dependencies and Ordering
Peios / Using Peios / Services and Jobs
Check a service's dependencies before stopping a shared component or diagnosing a blocked start. Requires waits for successful startup but leaves an already-running dependent alone if the target later stops. BindsTo also stops the dependent when its target goes away.
Relationships are set on the service that needs something, naming the target it needs. Wants attempts an optional target first; Conflicts makes two services mutually exclusive and is symmetric, so one side declaring it is enough.
Before changing a dependency #
- Read the dependent's definition with
svctl definition show <service>and inspect each target withsvctl status <target>. - Decide whether the requirement is successful startup (
Requires), optional startup ordering (Wants), runtime coupling (BindsTo), or mutual exclusion (Conflicts). - Use a readiness level when the target must have reached a specific condition, such as a routed network.
- After saving, validate the definition and check the next start. Dependency edits apply on a new start or graph reload; they do not rewrite a running process's history.
A DependencyFailure usually points to the target to investigate first. An
on-demand start can pull in other services and evict conflicting ones, so its
effects can extend beyond the service you named.
The four relationships #
Requires — a hard dependency #
If A Requires B:
- Start. B must reach a satisfying
state before A starts. If B
is not running, peinit starts it first (cause
DependencyStart). If B fails, A is marked Failed withDependencyFailureand never even attempts to start. - Stop. Stopping B does not stop A. Requires is a start-ordering constraint, not a runtime leash — A keeps running.
- Runtime failure. If B crashes while A is already Active, A is unaffected. B's own restart policy handles B's recovery.
Requires is the workhorse: "I need this to have started, and if it can't, neither can I."
Wants — a soft dependency #
If A Wants B:
- Start. peinit starts B before A if B exists and is not Disabled — but if B fails to start, or does not exist, A starts anyway.
- Stop / failure. No effect either way. A and B are runtime-independent.
Wants is best-effort ordering: "start this first if you can, but I work without it."
BindsTo — a runtime coupling #
If A BindsTo B:
- Start. Identical to Requires — B must satisfy before A starts.
- Stop. If B stops for any reason — explicit stop, conflict, crash,
shutdown — A is stopped too, transitioning to Stopping with cause
BindsToPropagation. When A finishes stopping it comes to rest in Failed (carryingBindsToPropagation), not Inactive — so astatusquery shows the bound service as Failed, making it clear it was taken down by its target rather than shut down cleanly. - Recovery. When B returns to Active, peinit automatically restarts A
from that Failed state (cause
BindsToRecovery). This is reactive — peinit watches B's transitions — and it is budget-exempt: A did not fail on its own, so the restart does not count against its budget. If B never comes back, A stays Failed until youreset(or start) it.
BindsTo is Requires plus a runtime leash: "I need this to start, and I
should not outlive it." It is the right choice for a sidecar that is
meaningless without its principal. BindsTo implies Requires; listing both
for the same target is harmless, and BindsTo semantics win.
Conflicts — mutual exclusion #
If A Conflicts with B:
- Start. Starting A while B is Active creates a stop operation for B
(source
ConflictResolution), evicting it (causeConflictEviction) before A starts — and vice versa. If the loser will not stop within itsStopTimeout, SIGKILL escalation applies. The evicted loser does not land in Inactive: it comes to rest in Failed (carryingConflictEviction), so it shows as Failed instatusand needs aresetbefore it will start again. That is deliberate — an evicted service is not a clean stop, and leaving it Failed stops it from quietly restarting straight back into the conflict. - Symmetry. Conflicts is two-way. If A declares
Conflicts=["B"], starting either stops the other; B need not declare it back.
Conflicts is for true mutual exclusion — two services binding the same port, or two implementations of one role where exactly one must run — not for ordinary resource contention.
At a glance #
| Start order | Target failure stops dependent? | Target stop stops dependent? | |
|---|---|---|---|
| Requires | target first; dependent fails if target fails | At start time only | No |
| Wants | target first if present; dependent starts regardless | No | No |
| BindsTo | target first; dependent fails if target fails | Yes (and auto-recovers) | Yes (and auto-recovers) |
| Conflicts | starting one evicts the other | n/a | n/a |
Waiting for a condition, not only a service #
A target can carry a readiness level after a colon.
Requires = ["network:routed"] waits not merely for the network manager to be
active but for it to have published the level routed — a default route in
place — and holds the start until it does. Publishers report a set of
true levels, and peinit checks membership. A routed network
publishes link, addressed and routed, so a service can ask for the
condition it actually needs. peinit clears the set the moment its publisher
leaves a satisfying state.
network there is a role, not a service: the service that fills it
declares Provides = ["network"], and peinit rewrites the entry to that
service before anything else looks at it. Write the role, not the daemon. The
levels link, addressed and routed are defined by network
policy, so the definition keeps meaning the same
thing whichever executor an image ships. svctl status shows the resolved
dependency, netd:routed on a standard image.
On-demand starts #
When you start a service explicitly rather than at boot, peinit does the same graph work on a smaller scope — the requested service's transitive closure:
- Collect all transitive
RequiresandBindsTodependencies (and best-effortWants). - Validate that sub-graph (cycles, missing targets).
- Resolve
Conflicts— stop anything that conflicts. - Start the sub-graph with the same parallel scheduler.
Anything already in a satisfying state (Active, Reloading, Completed, Skipped)
is left alone — its dependency is already met, so there is no needless
restart. Dependencies pulled in this way start with cause DependencyStart.
If two on-demand starts need the same dependency at once, their start
operations merge rather than
racing.
Failure propagation #
When a service enters Failed during graph execution, the failure spreads along
Requires and BindsTo edges — and only those:
- Every service that
Requiresthe failed one transitions to Failed withDependencyFailure. - Every service that merely
Wantsit is unaffected and starts normally. - Propagation is transitive: if A requires B and B requires C, and C
fails, then B fails, then A fails — each with
DependencyFailure.
This is the payoff of the Requires/Wants distinction. A hard dependency failing takes its dependents down with it; a soft one failing is shrugged off. Choosing the right relationship is choosing how far a failure is allowed to travel.
Graph validation #
Before peinit starts anything, it builds the dependency graph and validates it. Validation runs once per graph build — at boot for the whole boot graph, and per request for an on-demand start's transitive closure. It is not incremental.
Cycles. peinit topologically sorts the graph; if the sort fails, there is
a cycle. Every service in the cycle is marked Failed with CycleDetected,
and peinit logs the full path (dependency cycle: A → B → C → A) so you can
find and break it. A service can not depend on itself — a self-reference is
rejected as a cycle. If any service in the cycle is ErrorControl=Critical,
peinit downgrades to Safe mode
rather than rebooting, because a reboot would hit the same cycle.
Missing targets. What a missing target means depends on the relationship:
| Relationship | Missing or disabled target |
|---|---|
Requires | Dependent marked Failed (DependencyFailure). |
BindsTo | Treated as a missing Requires — Failed (DependencyFailure). |
Wants | Silently ignored — the entry is dropped. |
Conflicts | Silently ignored — nothing to conflict with. |
Unresolvable conflicts. If two boot-triggered services conflict with
each other, there is no way to honor both, so both are marked Failed with
ValidationError. As with cycles, if either is Critical, Safe mode applies.
Warnings. Some conditions are logged but do not block boot — most notably
a Readiness=Alive service that others Requires (see service
types). Warnings appear in the logs
and do not change state.
Validation errors. Some conditions do fail the service — for example a
health-check configuration that violates the flap
constraint. These mark the service
Failed with ValidationError.
When more than one finding applies to the same service, peinit records a
single primary cause by precedence — CycleDetected > ValidationError >
DependencyFailure — but it logs all findings, so the primary cause never
hides the others.
Parallel start #
After validation, peinit starts services whose dependencies are all satisfied, and it does so in parallel up to a configurable limit:
| Registry key | Default | Meaning |
|---|---|---|
Machine\System\Boot\MaxParallelStarts | 10 | Maximum services starting concurrently. |
The scheduler is simple: every service with no unsatisfied dependencies is
eligible; peinit starts up to MaxParallelStarts of them; as each one reaches
a satisfying state its
dependents become eligible and join the queue. The result is that independent
subtrees of the graph come up at the same time, while ordering constraints are
still honored exactly.
Shutdown reverses the graph #
peinit does not need a separate stop-ordering configuration.
Shutdown reverses the
dependency graph: services with no dependents stop first, and services that
others depend on stop last. A service is never stopped until everything that
Requires or BindsTo it has already stopped.
Shared platform services stop after their dependents, with registryd last.
The exact order comes from the installed graph; do not rely on a fixed list of
daemon names. The full shutdown sequence is in
Shutdown.
Where to start #
To see the states services move through as they start and stop in order, read The service lifecycle.
To understand how a target's failure interacts with the dependent's own restart policy, read Keeping services running.
To follow how dependency-driven starts appear as operations, read Jobs and operations.
Service Identity and Privileges
Peios / Using Peios / Services and Jobs
A service's Identity decides what its process can access. Its ServiceSecurity descriptor decides who can start, stop, or query it; the registry key descriptor decides who can edit the definition. Check the right boundary before changing permissions.
Read the definition with svctl definition show <service>. Prefer the
identity and privileges the service actually needs. An absent or empty
Identity means LocalService; SYSTEM must be explicit. peinit gives each
service a separate token and never shares its own SYSTEM token.
A distinct virtual service account #
Set Identity to Service to run under the service's own S-1-5-80-… SID as
its user identity. authd derives it from the attested service name, using the
same
case-insensitive derivation as the existing service group. Only SYSTEM PID 1
can
request the attestation. No local principal record or stored credential is
created, and this does not provide an interactive logon path.
Unlike shared LocalService, two differently named virtual services have distinct file and process owners. Grant storage access and policy privileges to the individual service SID. Renaming the service changes its identity and requires coordinated updates to those grants. The default remains LocalService for existing definitions; choosing Service is explicit.
The standard timed, resolvd and trustd deployments also use distinct Service identities, retaining their existing service-SID grants. Their SYSTEM preparation hooks, where present, remain separate from their main processes.
The standard eventd deployment uses this identity with SeChangeNotifyPrivilege, SeSecurityPrivilege (KMES consumption), and SeAuditPrivilege (event emission). Its System integrity level allows reception of higher-integrity client tokens; it does not grant SYSTEM account membership or SeTcbPrivilege. A short SYSTEM pre-start hook initializes registry authorization defaults, then exits before the long-running daemon starts. Private stores name eventd's own SID.
Services that need token minting/installation, raw network administration, device management, or pre-authd bootstrap still require separate assessment. Granting SeTcbPrivilege solely to make an identity change work defeats the purpose of moving a service out of the machine-wide trust boundary.
The local principal source lpsd also runs as Service, with only
SeChangeNotifyPrivilege and System integrity for handling client tokens. Its
package provisions its private state scope; credential files are owned by lpsd
and admit only lpsd and SYSTEM. Its administrative API still admits SYSTEM and
Administrators. /run/psi.sock admits service connections, but authd
registers a
source only when its enabled service SID matches the configured source
allowlist.
Transport admission does not confer source authority.
Privilege restriction #
A token comes from its source (authd or the SYSTEM mint) with a default set of
privileges. RequiredPrivileges lets a
definition trim that set down to only what the service needs:
- peinit reads the
RequiredPrivilegesallow-list and removes every privilege not on it from the token before exec. - Restriction is purely subtractive. peinit removes privileges; it never adds them. A service cannot acquire a privilege its token's source did not grant.
- If
RequiredPrivilegesis absent, the token's default privilege set is used unchanged.
This is least-privilege made concrete: eudev, for instance, runs as SYSTEM
(it needs device access during early boot) but with its privilege set stripped
to the minimum it actually uses, so a compromise of eudev does not hand an
attacker the full SYSTEM privilege set. Removal is permanent for the life of
that token — it is not a disable that the service can re-enable. See
Privileges for what the individual privileges
grant.
Which identity runs what #
A service is not only its main process — it has hooks, health checks, and a reload command, and each runs under a defined identity:
| Context | Runs as |
|---|---|
| Main process | The service's Identity. |
ExecStartPre / ExecStartPost | HookIdentity if set, otherwise the service's Identity. |
| Health checks | The service's Identity, always. |
ExecReload (command form) | The service's Identity, always — HookIdentity does not apply. |
| Submitted jobs | The submitting process's own primary token — or, if the submitter attached one, the token the kernel verified it could convey (its client's identity, when impersonating). Never an identity named in the request. |
Token materialisation for hooks follows the same rules: a HookIdentity of
SYSTEM is minted; any other principal is requested from authd, at the point
the hook runs.
HookIdentity exists so hooks can run with different — usually higher —
privileges than the service itself: creating directories in privileged
locations, or running a database migration as an admin identity, before the
long-running daemon drops to a lesser identity.
The per-service SID #
Every service token carries a SID derived from its service name. Granting
access to that SID can distinguish two services even when they share
LocalService. With Identity=Service, it is also the token's user identity.
Renaming a service changes its SID. Update grants that name the old SID as part of the same planned change. The SID derivation reference gives the algorithm.
How a token is materialised #
Identity=SYSTEM uses a separate token minted by peinit. Other identities use
authd; if authd cannot issue the required identity, the start fails rather
than falling back to SYSTEM.
The SYSTEM path #
Use SYSTEM only when the service requires that authority, such as the services
needed before authd is available. registryd and authd use this bootstrap
path. Standard eventd and lpsd deployments now use their own Service
identities and start through authd.
The authd path #
For a non-SYSTEM identity, check that authd is available and the account is
permitted for service logon. The authd.service.attested event records the
service, issued identity and privileges, or a refusal reason. peinit derives
an authority dependency for a non-SYSTEM service or hook identity.
The token-materialisation reference retains the minting and authority flow. The current authd request is specified in the TRM authd path.
Security invariants #
The identity model rests on a few rules peinit never breaks:
- peinit never shares its SYSTEM token. Even
Identity=SYSTEMservices get a separately minted token. - peinit never drops its own SYSTEM identity. PID 1 runs as SYSTEM for the life of the system — its identity is axiomatic, granted by the kernel at boot.
- Privileges are subtractive only.
RequiredPrivilegesremoves; it can never add. - Identity is deterministic. Every service runs as a known principal.
SYSTEMmust be declared explicitly; an emptyIdentityis the minimalLocalService, never SYSTEM. - A submitted job never runs as an identity its submitter could not act as. peinit installs only the submitter's own primary token or a token the kernel gated on the way in; it never opens a token by a PID or descriptor a submitter names, and there is no identity field to name one.
Where to start #
Identity decides what a service can do; the ServiceSecurity
descriptor decides who
can manage it — two independent concerns. Read Who can manage a
service for the other
half.
To see how the token is installed alongside the rest of the process setup, read The execution environment.
For the identity primitives themselves — tokens, SIDs, privileges — start at Tokens.
Token installation and executable trust #
The service child receives its prepared identity before exec. PIP is then established from the executable by the kernel; it is not chosen by the service account or inherited unchanged through exec. Peinit needs sufficient PIP dominance to manage protected services, but that does not make it the only trusted process or exempt it from service-management authorization.
The launch path does not add a per-service PSB mitigation request. Inherited mitigations and application self-hardening can still apply. Inspect the running process's committed mask, including after a replacement, rather than interpreting successful launch as proof of a requested hardening profile.
Peinit also does not populate the global TLP or CAAP caches or install mount policies. Those mechanisms require their own deployment owner. A service's readiness event proves only the readiness contract that service implements.
The Execution Environment
Peios / Using Peios / Services and Jobs
If a program works in your shell but fails as a service, compare its identity, environment, working directory, and standard streams. peinit does not inherit your logon session. It launches the program with the context in its definition.
Start with svctl definition show <service>, then inspect
svctl status <service> and the service's
logs. Check hook output as well
as the main program. Environment and working-directory changes reach the next
process start; they do not change a process already running.
The environment #
peinit constructs each service's environment in layers, lowest precedence first — it does not pass through its own near-empty startup environment.
- Compiled-in base. A fixed floor peinit always provides —
PATH:/bin. - Global
EnvVars. Each value underMachine\System\Init\EnvVars\becomes a variable (value name → variable name).EnvVars\PATHoverrides the basePATH; other names add. Every service gets this layer except registryd, which serves the key itself — see the warning below for why that exemption exists. - Per-service
Environment. The definition's ownKEY=VALUEentries, which override layers 1–2. - Protocol variables.
NOTIFY_SOCKET(always) andLISTEN_FDS/LISTEN_FDNAMES(only when stored fds are injected). These have the highest precedence and cannot be overridden — a service that clobberedNOTIFY_SOCKETwould break sd_notify.
A change to EnvVars\ takes effect on a service's next start, like the
per-service Environment field — it is not pushed into running services.
peinit deliberately does not set HOME, USER, LOGNAME, SHELL,
or TERM. Peios identity is a
token (a SID), not a
passwd entry, so there is no canonical home directory or sign-in shell to fill
in. A service that needs any of these supplies it through EnvVars\ or its
own Environment.
Working directory and limits #
| Field | Effect |
|---|---|
WorkingDirectory | The process's working directory. Must be a non-empty absolute path; defaults to /. |
LimitNOFILE | RLIMIT_NOFILE — the maximum number of open file descriptors. |
LimitCORE | RLIMIT_CORE — the maximum core-dump size, in bytes. |
peinit also sets oom_score_adj: -1000 (OOM-immune) for
ErrorControl=Critical services, and the default 0 for everyone else — so
the kernel never picks a Critical platform daemon as an out-of-memory victim.
Runtime directories #
RuntimeDirectories gives a service private scratch space under /run
without an ExecStartPre that has to mkdir it by hand. Each name you list
becomes a directory created **directly under /run ** —
RuntimeDirectories=myapp yields /run/myapp — set up immediately before the
main process starts. Each one gets a security
descriptor granting full access to
SYSTEM, Administrators, and the service's own
SID, so the service can
write to its directory while other principals cannot. If a directory can't be
created, or its descriptor can't be applied, the start fails with
ParentSetupFailure.
peinit does not remove these directories when the service stops. /run is
a boot-scoped tmpfs, so they disappear at the next boot rather than
being torn down on each stop — a restarting service finds its runtime
directory (though not necessarily its contents) already in place.
For the exact naming rules on each entry and the field's type and default, see the Registry key reference.
Standard streams #
peinit wires a service's standard streams before exec:
- stdin is redirected to
/dev/null. peinit never gives a service an interactive input channel; a service that needs input must obtain it explicitly (a socket, a stored fd). - stdout and stderr are redirected to pipes peinit holds, so it can capture and forward every line. This is the subject of Service output and logging.
Attaching a terminal #
A service that sets TTYPath to an absolute terminal path —
/dev/console, /dev/tty1, a serial line — gets that terminal on all three
standard streams instead of the wiring above, and becomes a session leader
owning it as its controlling terminal. That last part is what makes job
control work: Ctrl-C interrupts, fg /bg behave, and a hangup reaches the
process group. It is what a boot shell or a login prompt needs.
It carries a path rather than a flag because which terminal is a per-service
question: a maintenance shell on tty1 while the kernel console is a serial
line is an ordinary thing to want.
Two services pointed at the same terminal do not fight over it. peinit gives
the device to one of them and skips the rest — highest TTYPrecedence
wins — and a skipped service can ask to be started when the terminal frees,
with the tty:released trigger. See Queueing for a
terminal.
Pre-exec and post-exec hooks #
Hooks let a service do work around its main process without baking it into the binary.
ExecStartPreruns before the main binary. Each command runs in sequence, in thehooks/sub-cgroup; any hook exiting non-zero aborts the start (the whole cgroup is killed and the service Fails withPreHookFailure). Use it for prerequisites that must hold before the service starts — creating a runtime directory, waiting on a precondition.ExecStartPostruns after readiness (Simple) or after a successful exit (Oneshot). A post-hook failure is logged but does not fail the service — by the time it runs, the service is already up. (A Oneshot that fails never runs its post-hooks.)
Hooks run under
HookIdentity if set,
otherwise the service's own identity. Their output is captured and tagged like
the main process's, labeled with the hook (for example
jellyfin/ExecStartPre[0]).
Command string parsing #
The command fields — ExecStartPre, ExecStartPost, ExecReload,
HealthCheck — are parsed into an argument list with simple, predictable
rules. peinit never invokes a shell.
- Whitespace splits the command into arguments; double quotes group text
containing spaces into one argument and are not retained (
--name="hello world"→ one argument--name=hello world). - There is no shell expansion, variable substitution, or globbing. Backslash is literal; a single quote is an ordinary character.
- The first argument is the executable and must be an absolute path
beginning with
/. Relative names and PATH search are validation errors. - An empty or whitespace-only command, or an unclosed quote, is a validation error.
If a command genuinely needs shell features, wrap it in a script and point the field at the script.
ExecReload can also be a signal, written signal:<NAME> — for example
signal:SIGHUP. The name must be an exact, canonical Linux signal name
(uppercase, no aliases, no numbers); SIGKILL and SIGSTOP are rejected
because they cannot be handled as a reload. With no ExecReload at all,
reload sends SIGHUP. The reload lifecycle is covered in Controlling
services.
Conditions and asserts #
Before peinit runs any hook or the main process, it evaluates conditions
and asserts — start-time checks in the same type:argument form. The
difference is what failure means:
- A failed Condition skips the service — it transitions to Skipped, which satisfies its dependents (it succeeded by not needing to run). Conditions express "only run here if it makes sense."
- A failed Assert fails the service — it transitions to Failed with
AssertionError. Asserts express "this was expected to run, and a precondition is missing."
Conditions are checked first; only if all pass are asserts checked. All entries are AND-ed. The check types:
| Type | Form | Passes when |
|---|---|---|
path | path:<path> | the path exists (any type) |
file | file:<path> | a regular file exists |
directory | directory:<path> | a directory exists |
registry | registry:<key> | the registry key exists |
Two constraints follow from peinit being single-threaded PID 1, which must never block:
registry:checks are cache-only. Accepted paths are exactlyMachine\System\Services,Machine\System\Init, andMachine\System\Services\<name>with one nonempty service-name component. The roots resolve as present; the last form checks whether the service exists in the in-memory model. Init descendants, deeper Services paths, trailing separators, and other keys are load-time decode errors. No live registry read is made.- Filesystem checks run off the main loop.
path:/file:/directory:checks are performed by a short-lived forked helper, not astat()on the event loop, becausestat()can wedge on a hung mount.
That timeout is the PreStartCheckTimeout field, which defaults to 5
seconds. A filesystem check that does not finish within it — say a stat()
wedged on a hung mount — is treated as not satisfied, fail-safe: peinit
kills the helper and treats the check as unmet, so a Condition skips the
service and an Assert fails it, rather than letting the event loop hang.
The fd store #
The fd store lets a service preserve file descriptors across restarts —
most usefully a listening socket, so a stateful daemon can restart without
dropping connections. It is opt-in: FdStoreMax (default 0) sets the maximum
number of fds peinit will hold; 0 disables it.
The mechanics ride on sd_notify:
- A service stores an fd by sending
FDSTORE=1with the fd attached (and optionallyFDNAME=<name>; the default name isstored). peinit holds it. - It removes one with
FDSTOREREMOVE=1andFDNAME=<name>. - On the next start, peinit injects the stored fds starting at fd 3, sets
LISTEN_FDSto the count andLISTEN_FDNAMESto the colon-separated names, then clears the store. (This is the sameLISTEN_FDSconvention systemd uses, so software with existing fd-passing support works unmodified.)
The store survives an automatic restart (crash → restart policy → new start) — that is the whole point. It is cleared on an explicit stop or shutdown (the service is not coming back), and when a removed definition is finally discarded.
A clean context #
A service receives its standard streams and explicitly supplied descriptors. It does not inherit peinit's privileged connections or signal handling. The launch-isolation reference describes the descriptor and signal setup.
The cgroup tree #
peinit tracks a service's main process, hooks, and health checks in separate
cgroups beneath /sys/fs/cgroup/peinit/. It uses those groups for tracking
and clean termination, not resource limits.
A leaked cgroup warning means a process survived cleanup, often because I/O is
stuck. A later start can use a fresh <service>.gen<N> tree; that does not
repair or kill the stuck old process. Investigate the Abandoned
state.
The cgroup
reference
retains the layout and rationale.
Where to start #
For the identity half of the launch — how the token is chosen and installed — read Service identity and privileges.
For what happens to the stdout/stderr pipes peinit holds, read Service output and logging.
For how conditions, asserts, and hooks fit into the start sequence and its states, read The service lifecycle.
System-console aliases and logout #
Peinit pins TTYPath=/dev/console to the kernel-selected terminal when
reading
service definitions. A display's moving tty0 alias becomes tty1, so
switching
the foreground console does not move the session. Both arbitration and launch
use this fixed endpoint. When a terminal service's main process exits, peinit
kills its remaining session processes before handing the terminal on. A clean
exit under RestartPolicy=Always restarts the prompt at the base delay
without
spending the crash budget.
Who Can Manage a Service
Peios / Using Peios / Services and Jobs
To let someone start or stop a service, change its ServiceSecurity permissions. Do not give them write access to the service definition to grant control: definition writes can change the program and the identity it runs as.
In Services Manager, select the service and inspect the commands you can
use. Who can control it… edits runtime control; Who can change its
definition… edits the registry key's permissions. If a command returns
ACCESS_DENIED, check its required right and the caller's identity before
widening either descriptor.
Two descriptors, two questions #
A service is associated with two descriptors that are easy to conflate but answer different questions and are enforced by different components:
| Descriptor | Question | Stored | Enforced by |
|---|---|---|---|
| Registry key SD | Who can read or edit the definition? | On the Machine\System\Services\<name> key | LCS, at key-open time |
| ServiceSecurity SD | Who can manage the running service? | As the ServiceSecurity binary value on that key | peinit, on every control command |
The registry key SD is ordinary registry access control and not peinit's concern — peinit reads definitions as SYSTEM, which has full access. The ServiceSecurity SD is peinit's domain, and the rest of this page is about it.
They are genuinely independent. An administrator might be able to query a
service's status (ServiceSecurity grants SERVICE_QUERY_STATUS) but not
read its configuration (the registry key SD denies read) — or the reverse.
Runtime control and configuration access are separate concerns, and both
combinations are valid.
Changing them from the desktop #
On a GXWI desktop, select the service in Services Manager. Below what you can do with it, the details pane says where its ServiceSecurity comes from: set for this service, the default set for every service, or peinit's built-in default. Two buttons open the permissions editor, and both are also on each row's right-select menu.
- Who can control it… opens the ServiceSecurity descriptor. Its boxes are
the service rights in words: Full control, Start, Stop,
Reload (
SERVICE_INTERROGATE) and See its state (SERVICE_QUERY_STATUS). Restart needs Start and Stop together, and Reset needs Stop. When you apply, Services Manager writes the result as the service's ownServiceSecurityvalue. From then on, a change to the default does not reach that service. peinit applies the new descriptor on the next command, and the window's buttons change to match. - Use the default appears beside it once the service has its own value. After you confirm, it deletes that value, so the service takes the default again.
- Who can change its definition… opens the descriptor of the service's registry key. Its boxes are Full control, Read, and Write on the key. Entries you add there apply to the key and to any keys under it.
Under Every service, the pane says what a service without its own value takes:
- Default permissions… opens the
ServiceSecurityonMachine\System\Services. If there isn't one, it starts from peinit's built-in default. Applying writes it to that key, and it reaches every service without its own value at the next command. - Use the built-in default appears once that key has a value. After you confirm, it deletes the value, so services without their own go back to peinit's built-in default.
Each of these is offered for changing only if you are allowed to change it:
- ServiceSecurity is a value on a registry key: the service's key, or
Machine\System\Servicesfor the default. Changing it, or deleting it, needs the right to set values on that key (KEY_SET_VALUE). - The service key's own descriptor needs
WRITE_DAC, andWRITE_OWNERfor its owner.
If you are not allowed, the editor still shows who can do what and says why it can't be changed, and the two "use the default" buttons are unavailable with the reason. Services Manager finds this out by asking the registry for those rights, not from your group memberships.
The same can be done from a terminal with reg. For example, this makes sshd
take the default again:
Service access rights #
The ServiceSecurity descriptor grants these rights:
| Right | Bit | Grants |
|---|---|---|
SERVICE_QUERY_STATUS | 0x0001 | Query state, PID, cause, health, warnings. |
SERVICE_START | 0x0002 | Start the service. |
SERVICE_STOP | 0x0004 | Stop the service. |
SERVICE_INTERROGATE | 0x0008 | Reload the service. |
SERVICE_ALL_ACCESS | 0x000F | All of the above — the "full access" granted to SYSTEM by default. |
restart requires both SERVICE_STOP and SERVICE_START, since it is a
stop followed by a start. reset requires SERVICE_STOP.
When peinit evaluates the descriptor it maps the generic rights as follows, so a descriptor written with generic rights behaves sensibly:
| Generic | Maps to |
|---|---|
GENERIC_READ | SERVICE_QUERY_STATUS |
GENERIC_WRITE | SERVICE_START | SERVICE_STOP | SERVICE_INTERROGATE |
GENERIC_EXECUTE | SERVICE_START | SERVICE_STOP | SERVICE_INTERROGATE |
GENERIC_ALL | SERVICE_ALL_ACCESS |
The default descriptor #
If a service has no ServiceSecurity value, it inherits the one on
Machine\System\Services itself. If that key has none either, peinit applies
a built-in default:
- SYSTEM (
S-1-5-18) — full access. - Administrators (
S-1-5-32-544) — full access. - Authenticated Users (
S-1-5-11) — query only. - Everyone (
S-1-1-0) — every refusal audited, in its SACL.
So out of the box, administrators can do anything with a service, everyone who
is signed in can see what it is doing, and every refused command is recorded.
To let someone else start or stop a particular service, give that service a
ServiceSecurity that grants it; anyone signed in can reach the control
socket, so a grant to them takes effect.
ServiceSecurity is hot-reloaded: a change to the value in the registry takes effect on the next control request, with no service restart. peinit picks the change up through a registry notification. This is why ServiceSecurity is in its own mutability class — access policy should be able to change without disturbing a running service.
How a command is authorized #
Every control command runs the same gate:
- peinit captures the caller's
token from the kernel
(the
KACS_SO_PEER_TOKENsocket option) — the caller's effective identity at connection time, so if the caller is impersonating, the impersonated identity is what is checked. - peinit resolves the target service and its ServiceSecurity descriptor.
- peinit runs AccessCheck: the caller's token against the descriptor, for the right the command needs.
- Denied → return
ACCESS_DENIED. The kernel records the attempt — caller, target service, rights requested, and granted — as akacs.audit.access.checkedevent, because the descriptor's SACL asks it to. - Granted → execute the command.
The system control descriptor #
Some operations are not about any one service — shutdown and reload-config
act on the whole system, and boot reports on it. These are checked against
peinit's own descriptor, stored at Machine\System\Init\ControlSecurity:
| Right | Bit | Grants |
|---|---|---|
SYSTEM_SHUTDOWN | 0x0001 | Initiate poweroff, reboot, or halt. |
SYSTEM_RELOAD_CONFIG | 0x0002 | Re-read all definitions and rebuild the graph. |
SYSTEM_QUERY_STATUS | 0x0004 | Ask how this boot went (svctl boot). |
| Generic | Maps to |
|---|---|
GENERIC_READ | SYSTEM_QUERY_STATUS |
GENERIC_WRITE | SYSTEM_RELOAD_CONFIG |
GENERIC_EXECUTE | SYSTEM_SHUTDOWN |
GENERIC_ALL | all three |
The default grants SYSTEM and Administrators all three rights, and
Authenticated Users SYSTEM_QUERY_STATUS, as the default service
descriptor lets everyone signed in query a service. peinit loads this
descriptor at boot and hot-reloads it on registry change, exactly like
ServiceSecurity. A descriptor written before SYSTEM_QUERY_STATUS existed
grants it only through GENERIC_READ, GENERIC_ALL or the bit itself.
Jobs have descriptors too #
A submitted job is a securable
object in the same way. It carries its own descriptor from the moment it
exists — by default owned by the submitter and granting JOB_QUERY,
JOB_STOP, and JOB_SIGNAL to the submitter, SYSTEM, and Administrators,
and nothing to the identity the job runs as — and every job command, on
either socket, is checked against it. The one thing no descriptor inside
peinit governs is who can submit: that is the file descriptor on the jobs
socket, checked by the kernel when a process connects.
The list command filters, it does not deny #
list is access-control-aware in a quieter way: it returns only the services
the caller has SERVICE_QUERY_STATUS on, and omits the rest. A
caller with no query rights gets an empty list, not a denial. What this
protects is a service's state; that a service exists is not a secret. A
command naming a service is answered UNKNOWN_SERVICE only if it does not
exist, and the definitions under Machine\System\Services are readable.
The boundaries that hold #
A few invariants are worth stating outright, because they are what make this trustworthy:
- peinit never bypasses AccessCheck for a control operation. No backdoor, no override flag, no "trust localhost."
- The descriptors are the only policy inputs. peinit consults the ServiceSecurity and ControlSecurity descriptors and nothing else — not config files, not environment variables, not hardcoded lists.
- One service's state is never exposed to another without a check.
statusis per-service access-controlled;listfilters. The same holds for jobs:job statusis checked,job listfilters.
Where to start #
For the other half of the security model — what a service can reach once it is running — read Service identity and privileges.
For the commands these rights gate, read Controlling services.
For the descriptor and AccessCheck machinery itself, read Security descriptors and Access decisions.
Service Registry Keys
Peios / Using Peios / Services and Jobs
peinit reads its configuration from four places in the registry. This page
says what each one holds and which guide explains it. The registry manual
for each value, shown by regman, is the authority for its type, default,
valid range, and when a change takes effect.
Where peinit's settings live #
peinit reads these keys:
| Key | Holds | Guide |
|---|---|---|
Machine\System\Services\<name> | One service definition per subkey. Only ImagePath is required. | Defining a Service |
Machine\System\Boot | Boot limits and timeouts: parallel starts, the success grace period, the settle timeout, and shutdown timeouts. | Boot and Boot Modes |
Machine\System\Init | Operational parameters: control and jobs socket limits, service output limits, default environment variables, and boot-time path provisioning. | Operational parameters |
Machine\System\eventd | LogSocketPath, the socket that peinit forwards service output to. | Finding Service Logs |
Replace <name> with the service's name. peinit learns about edits to
service definitions through a registry watch. Saving a value doesn't mean
that a running service has adopted it; each value's manual says when a
change applies.
Looking up a value #
Use regman with the key's path to read the documentation for every value
under it:
regman reads the installed documentation, not the live registry. Use
reg to read the value configured on this machine.
To check a whole definition before peinit uses it, run
svctl definition validate.
Operational parameters #
The values under Machine\System\Init bound peinit's own resources. They
fall into four groups:
- Control and jobs sockets. The security descriptor for system-level control operations, connection counts, request and message sizes, idle timeouts, and the number of live jobs each submitter can hold. See Controlling Services and Jobs and Operations.
- Service output. Line length, the buffer for each service, and the output held before eventd starts. See Finding Service Logs.
EnvVars. Default environment variables for the services peinit starts once the registry is available. Protect this key's security descriptor: every value written here reaches those services. See The Execution Environment.ProvisionedPaths. Directories and files that peinit creates and secures during boot. See Boot and Boot Modes.
Values peinit writes #
peinit records the last run of each persistent timer, in the LastTimerRun
value or the TimerState subkey of the service's definition. Don't edit
these values. See Triggers and Timers.
The peinit technical reference manual lists every key from the implementation's side.
Boot and Boot Modes
Peios / Using Peios / Boot and Shutdown
On a running machine, use svctl boot or System Settings › Startup &
Shutdown to see the mode, why it was chosen, and whether the boot has been
confirmed successful.
- Full starts the normal boot-triggered set.
- Safe starts a reduced boot-triggered set. Use the reported graph error or requested-mode reason to decide what to repair.
- Recovery provides an unrestricted SYSTEM shell on the console and skips
Phase 2 services.
svctl bootis not available there.
How this boot went #
svctl boot asks peinit, and so does System Settings, at the top of its
Startup & Shutdown section:
$ svctl boot
boot: full
reason: normal
unconfirmed boots before this one: 0 (recovery at 3)
confirmed: yes
grace: 30s
- boot is the mode, and reason why:
normal,requested(peios.safemode=1), or a Safe mode peinit chose itself because a full boot couldn't be planned, with what stopped it. - unconfirmed boots before this one is the boot-attempt counter as this boot found it, and the threshold at which the machine starts in Recovery.
- confirmed says whether this boot has counted as a success yet: every
Critical service holding for
BootSuccessGrace, and the counter put back to 0. Until then it names what it is waiting for.
Recovery mode never answers: it runs a recovery shell and no Phase 2 services or peinit control interface. Registryd can already be running, but there is no control socket to ask. Anyone signed in can ask; see who can manage a service for the descriptor.
The three boot modes #
The three modes form an escalation path from normal operation to last-resort maintenance.
flowchart TD
F["Full boot"] -->|success| OK["operational<br/>counter reset"]
F -->|cycle/conflict w/ Critical| S["Safe mode<br/>(no reboot)"]
F -->|Critical failure| RB["sync + reboot"]
S -->|success| OKS["operational (reduced)<br/>counter reset"]
S -->|Critical failure| RB
RB --> CNT["counter increments"]
CNT -->|counter ≥ N| REC["Recovery mode"]
F -.->|Phase 1 failure| REC
Full mode #
The default. All boot-triggered services start in dependency order. A boot is
successful — and the boot-attempt counter
resets to 0 — when every Critical service has reached and held a
dependent-satisfying state (Active, Completed, or Skipped) for a grace period
(BootSuccessGrace, default 30 s). The criterion is "satisfying," not
"Active," so that a Critical Oneshot that reaches Completed can still mark the
boot good.
Safe mode #
Safe mode starts a reduced set of boot-triggered services and rebuilds the graph from scratch using only those, dropping dependencies on excluded services. Two categories are eligible:
- Critical services (
ErrorControl=Critical) — must start; a Critical failure here still follows the normal reboot path. - SafeMode services (
SafeMode=1) — best-effort; if they fail, Safe mode carries on without them.
Everything else is skipped. Safe mode is entered when:
- graph validation finds a cycle involving a Critical service, or
- an unresolvable conflict involving a Critical service, or
- the kernel command line says
peios.safemode=1.
The first two are configuration errors — rebooting would hit them again — so peinit downgrades without rebooting. Safe mode is not entered by a Critical service crashing at runtime; that follows the reboot path. And it is purely a boot-sequencing concern: once booted, you can start any service by hand exactly as in Full mode. It is the mode for "the configuration is broken but the TCB is healthy."
On a machine with the dynamic-boot feature, System Settings › Startup &
Shutdown › Always Start in Safe Mode puts peios.safemode=1 on the command
line the next boot image is made from. Its next-boot effect depends on a
successful rebuild to the intended boot partition; verify the activation
chain.
Once present in the booted image it holds until changed there, and while the
machine is in Safe mode because of it, System Settings says so.
Recovery mode #
Recovery mode is the last resort, and it offers no TCB guarantee — the administrator gets an unrestricted SYSTEM shell on the console and must treat it with corresponding care. It is a maintenance environment, not a degraded boot.
In Recovery, peinit completes the Phase 1 basics and starts registryd only if
that boot has not already attempted it; a failed registryd start is not
repeated. Registryd failure does not prevent the shell. peinit skips all Phase
2 services and execs a SYSTEM shell on /dev/console (/bin/recsh if
present, else /bin/sh), respawning it if it exits. It is entered when:
- the boot-attempt counter reaches N (default 3),
- the kernel command line says
peios.recovery=1, or - registryd fails during Phase 1 — entered immediately, without rebooting, because there is no Phase 2 to attempt. The counter has already been incremented for this attempt.
Preserve the console failure reason and any source startup diagnostics first. Identify the installed registryd provider, its version, hive declarations and database paths. Recovery does not establish that the registry source is stopped: a source started or attempted earlier in the boot can still be active. Do not start a second source against the same hive files.
Offline inspection or repair needs a procedure supported by that provider and version. The source-checked loregd implementation has no offline repair switches and does not create an automatic startup backup. Its orphan cleanup is not corruption repair or backup restoration; the references identify the checked revision. Verify the existence and coverage of any recovery copy before planning to replace data.
Follow Recovery troubleshooting for the evidence to collect and the point to involve the administrator or provider. If the source can serve the required operations, the supported Backup and restore workflow can recover a subtree; it depends on that working source and is not offline source repair. Restore replaces data and permissions. Role definitions can re-supply service configuration but do not restore all registry data.
The boot-attempt counter #
The counter can escalate repeated unconfirmed boots to Recovery when peinit
reaches the increment and can persist it. It is a plain integer in a file at
/.peinit/boot-attempts — not in the registry, because the registry can be
the very thing that is broken. A confirmed boot resets the count; the counter
does not guarantee that every reboot loop ends in Recovery.
- peinit reads it at startup, before choosing a mode. The Recovery
threshold (
counter ≥ N) is checked against this pre-increment value, so the default N of 3 admits exactly three attempts before Recovery. A missing file counts as 0; a corrupt or unreadable one → Recovery. Override N withpeios.bootattempts=Non the kernel command line, or set it to0to disable the check when the counter is itself the fault. - peinit increments it once per boot after the root, mount, seed, machine-ID and clock steps, before registryd starts. A registryd startup failure therefore still consumes an attempt. An earlier failure that enters Recovery before this point does not increment it.
peios.recovery=1forces Recovery but does not suppress the increment once that point is reached.- The counter is reset to 0 on a successful Full or Safe boot (after the grace period).
- If the counter file cannot be written (disk full), peinit treats it as 0 and continues — a write failure must not by itself trigger Recovery.
A Critical service exhausting its
restart budget — at boot or at runtime — triggers a sync and reboot. Repeated
boots that never complete the success grace accumulate attempts until the
counter reaches N and peinit enters Recovery. A failure after a confirmed boot
still reboots the machine, but that boot already reset the counter: repeated
late failures can therefore continue without reaching the Recovery threshold.
Use svctl boot to distinguish these cases. The counter deliberately does
not try to catch a peinit too broken to reach its own increment; that is a
binary-integrity problem, not a boot-loop problem. See the TRM counter
cycle
for the exact increment boundary.
Boot configuration #
| Key | Default | Controls |
|---|---|---|
Machine\System\Boot\MaxParallelStarts | 10 | Services starting concurrently (must be > 0; invalid → Recovery). |
Machine\System\Boot\BootSuccessGrace | 30 | Seconds a Critical service must hold a satisfying state before boot counts as successful. |
Machine\System\Boot\ShutdownTimeout | 90 | Maximum seconds for the whole shutdown sequence. |
Machine\System\Boot\PostKillTimeout | 5 | Seconds a service cgroup can take to drain after SIGKILL before it counts as stuck. |
Machine\System\Boot\SettleTimeout | 5 | Seconds peinit waits for the boot service set to settle before starting boot:settled services anyway. |
All but ShutdownTimeout are read at boot, so a change applies at the next
one; ShutdownTimeout applies the next time peinit re-reads its configuration
(svctl reload-config). System Settings shows and changes them in its
Startup & Shutdown section, under Timeouts: Apply and Undo
appear once one has been edited. Changing them needs write access to
Machine\System\Boot — as shipped, Administrators.
The kernel command line #
peinit reads the following peios.* tokens. They are deliberately few:
everything peinit can read after registryd is serving belongs in the
registry instead, where it can be inspected, secured and changed without
editing a boot entry. What is left is either a per-boot mode decision or a
Phase 1 value — one peinit needs before there is a registry to ask.
| Token | Effect |
|---|---|
peios.safemode=1 | Force Safe mode. |
peios.recovery=1 | Force Recovery mode, whatever the counter says. |
peios.bootattempts=N | Override the boot-attempt threshold; 0 disables the check. |
peios.notifysocket=PATH | Move the sd_notify socket. Phase 1, because registryd is the first service to use it and it must be bound before registryd starts. |
peios.quiet=N | How much peinit can write to the console: 0 write everything, 1 (default) stay out of a terminal a service owns, 2 also drop ordinary progress. See below. |
Console noise: peios.quiet #
peinit reports its progress to /dev/console, and so does any service that
claims that terminal with
TTYPath. Two writers, one
device: a sign-in prompt started while peinit is still narrating gets written
over, and the reader cannot tell input from log. peios.quiet decides who
yields.
It sets two independent rules, which is why it is a level and not a flag:
| Terminal a service owns | Everywhere else | |
|---|---|---|
peios.quiet=0 | peinit writes anyway | everything |
peios.quiet=1 (default) | only messages that mean the machine is about to be lost | everything |
peios.quiet=2 | only messages that mean the machine is about to be lost | errors only |
The rules stack rather than scale: errors are never less visible at 2
than at 1. An error overrides a requested blackout — silence was a
preference, and an error is news — but it does not override terminal
ownership, which is not peinit's to override. Only losing the machine
(dropping to Recovery, halting with no shell, a Critical
service about to force a reboot) is worth one corrupted line of somebody
else's session.
prelude honors
peios.quiet=2 as well, since it writes to the same console. The other two
levels mean nothing there — prelude exits before the first service starts, so
no terminal has an owner yet.
A few lines escape all of this: whatever peinit and prelude print before they have read the command line. Neither can honor a preference it has not seen yet, and those lines are also the only evidence either started at all.
Seeing and changing it #
System Settings shows the command line this boot was started with, under
Kernel Command Line in the Startup & Shutdown section, and the one the
next boot image will be made from, /lcl/etc/boot/cmdline, where they
differ.
On an installed machine the command line is part of the boot image, so editing
that file changes nothing on its own. Dynamic Boot supplies mkuki-watch,
but package delivery or feature enablement alone does not mean it is running
or rebuilding successfully. Check its selected input, output filesystem, and
completed rebuild using the activation
checklist.
With the feature installed, System Settings offers peios.bootattempts and
peios.quiet as choices — how many boots can fail before Recovery, and what
peinit writes on the console — and writes them into the file with Apply at
Next Boot, which appears once one has been changed. Nothing else on the line
is offered: a mistake there can leave a machine that doesn't boot. Writing the
file needs write access to it, which as shipped only Administrators have.
Unknown peios.* tokens are ignored, as is a malformed value on a valued
token — this parser runs before anything exists to report a diagnostic to, and
refusing to boot over a typo in a tuning knob is the worse outcome.
Where peinit takes over #
peinit is PID 1, but it is not the first thing that runs. The initramfs assembles and mounts the real root — decryption, RAID/LVM, the root filesystem itself — and then hands control to peinit. The contract peinit relies on is narrow:
- The real root is already mounted read-write, and
/proc,/sys,/devare mounted and moved into it. - peinit is exec'd as PID 1 from a fixed path on the real root.
peinit does not assemble, decrypt, repair, or even re-mount the root —
those need tools and configuration that belong to the initramfs. It also does
not fsck the root or mount non-root storage (a data partition is mounted by
an ordinary Oneshot service, not by peinit). For the trust and identity side
of this handoff — signatures, the SYSTEM token peinit inherits — see peinit
at PID 1.
Phase 1: the hardcoded bootstrap #
Phase 1 is compiled into peinit. It cannot change at runtime and touches no registry. It does the minimum to make Phase 2 possible:
- Confirm the root is writable with a single probe write. registryd's storage needs a writable root even for reads, so a read-only root cannot support Phase 2 → Recovery.
- Mount the remaining virtual filesystems —
/dev/pts,/dev/shm,/run,/sys/fs/cgroup— mounting each only if absent. A failure here → Recovery. - Restore the persisted random seed from
/var/state/peinit/random-seed, mixing it into the kernel's entropy pool early so anything that needs randomness during boot gets it. A missing seed is normal — first boots and stateless live boots have none — so peinit carries on; a seed problem is never fatal and never sends boot to Recovery. - Establish the machine-id from
/lcl/etc/machine-id— a stable, opaque identifier for this install (used for log correlation, instance identity, and software compatibility). It is not a security principal: it is not a SID, an account, or a credential, and no authorization decision depends on it. If the file is missing, empty, or malformed, peinit generates a fresh 128-bit ID. If it cannot persist the ID, boot continues with a warning and an ID valid only for this boot; failure to obtain random bytes sends boot to Recovery. - Set the clock from the hardware RTC, so early timestamps and the boot counter are meaningful. A failure here → Recovery.
- Start registryd and wait for it to signal readiness, then probe-read the schema-version key to confirm it is actually serving reads. Any failure → Recovery — there is no Phase 2 without a registry.
- Provision boot-time paths. With registryd up and before Phase 2 starts,
peinit applies the entries under
Machine\System\Init\ProvisionedPaths\— the registry-driven equivalent of tmpfiles.d, creating directories, and files (with Peios security descriptors) that no single service owns. Best-effort entries that fail are logged and skipped, but an entry markedRequired=1that cannot be provisioned sends boot → Recovery. The individual keys are cataloged in the registry key reference. - Infrastructure setup — create the control socket and the jobs socket, and bring up the loopback interface. A control-socket or jobs-socket failure → Recovery; a loopback failure is logged as a warning and boot continues.
Most Phase 1 failures are fatal to a normal boot, because none of the later machinery can run without this foundation — the only outcome is Recovery mode. The exceptions are the fail-soft steps called out above: a missing or unusable random seed, a regenerated machine-id, and best-effort provisioned paths all let boot continue.
registryd #
registryd is an interface, not a specific program. It is the path peinit
execs to get a registry source daemon — the component that implements the
registry's persistent storage and answers peinit's reads. The implementation
behind that interface can vary; by default it is loregd.
The distinction matters when diagnosing source failures: peinit's registryd
role does not define a storage-repair interface. Check which provider and
version the installation uses before choosing recovery instructions. The
default provider's database paths come from its startup hive declarations, not
registry settings. See LCS and
sources for source
availability checks and the Recovery-mode limits before
direct storage work.
Phase 2: the registry-driven boot #
With registryd serving reads, peinit boots the rest of the system from the registry:
- Read all definitions under
Machine\System\Services\. (A registry read timing out here → Recovery.) - Build and validate the dependency graph from the boot-triggered services and their transitive dependency closure. Validation runs before anything starts.
- Start services in dependency order, in
parallel up to
MaxParallelStarts, with readiness gating releasing each service's dependents as it becomes satisfied.
Only services with a boot trigger are start candidates; demand-only services
are pulled in only if something boot-triggered depends on them, and
Disabled services are excluded
from the graph (but kept in the model for on-demand start). The whole boot
runs against one snapshot —
mid-boot registry edits do not perturb it.
The installed service graph determines the platform order. registryd and
authd use the SYSTEM bootstrap path; standard eventd and lpsd deployments
use Identity=Service and obtain tokens through authd. See Service
identity. A non-SYSTEM
service's authority dependency is derived from its identity rather than left
to an administrator to remember.
Do not infer readiness or shutdown order from a fixed list of daemon names. Check the installed definitions and the service status. The boot implementation describes graph construction and validation.
Where to start #
To understand the graph validation and parallel start that drive Phase 2, read Dependencies and ordering.
To understand the Critical-failure reboot path that feeds the boot counter, read Keeping services running.
For the trust and token side of early boot, read peinit at PID 1.
Prelude
Peios / Using Peios / Boot and Shutdown
Prelude starts the userspace part of Peios boot. It runs inside the initramfs, a small filesystem unpacked into memory, until boot hooks have made the real root filesystem available. It then replaces itself with the init that manages the running system.
The two programs keep the same process number, 1, but have different jobs. Prelude prepares one handoff. The real-root init manages services after it. Storage discovery, unlocking, and root mounting belong to hooks supplied by the image's packages.
From temporary root to real root #
Prelude mounts the kernel's process, system, and device filesystems. It
seeds access control on existing device nodes, then reads the sequence of
hooks written by mkirf. The sequence tells it which hooks can run and
which capabilities each hook needs.
A hook mounts the real root at /mnt/rootfs. Prelude checks that this is a
different filesystem from the temporary root, moves the kernel filesystems
into it, removes the old temporary files where possible, and changes its
root directory. A successful exec transfers control to the selected init.
The complete parameter and path reference is prelude(8).
Why hook outcomes matter #
A hook can finish its work, decline because it does not apply to this machine, or defer because an input is not ready. Deferral is safe only when the hook has made no changes. Prelude retries deferred work after another hook makes progress; it does not retry a failed hook that might have left partial changes.
Capabilities let a hook depend on a result instead of another hook's name.
For example, several storage hooks can contribute toward preparing storage.
A later hook waits for their contributions before using it. The runtime
format and precise outcome rules are described in prelude-hooks(5).
Hooks can source /usr/libexec/prelude/hook-log.sh for consistent status
messages. The helper prints message text literally, so a backslash in a
filename keeps its meaning when color is enabled.
Access control during boot #
The initial device policy grants full access to SYSTEM and Administrators. An inherit-only CREATOR OWNER entry gives a creator control over the objects it creates. The policy does not grant Everyone access: a broad inherited grant could expose raw disks as well as ordinary device nodes.
A failure to seed device descriptors produces a warning and boot continues. A hook failure or missing real root stops the handoff. Those outcomes need different responses; a completed boot does not prove every device received its intended descriptor.
Assembling and updating the temporary root #
The conventional source tree is /boot/initramfs. It must contain Prelude,
its interpreter and helper dependencies, the hook sequence, and the drivers
needed to reach the target root. The mkirf build resolves hook ordering;
Prelude consumes that result. An ordinary source-tree edit does not change an
already-built initramfs or UKI. Rebuild the artifact, deploy it through the
image's boot workflow, and verify which artifact the next boot actually loads.
The temporary root is independent of the installed root. A helper available
under the installed /usr is not thereby available before handoff. Include
its dynamic loader and libraries, or use an appropriate static build. Do not
assume runtime /bin and /lib views exist before their topology hook runs.
Module availability, dependency closure, loading, and root readiness are separate checks. Include modules matching the booted kernel and their required providers. A package-supplied coldplug hook can scan modaliases in a bounded settling window; Prelude itself is not a hotplug manager. A module loading failure matters according to whether a later hook can still prepare the root. Hardware that appears after that window needs the real-root device manager or an explicit boot design.
For storage changes, preserve a known bootable artifact and test the intended
hardware or recorded VM image. Do not infer that every firmware-dependent or
network-root configuration fits a generic storage-only module set. The exact
init selection, fallback paths, and root-switch behavior are in prelude(8);
the supplied image decides which candidates and tools exist.
Authoring hooks #
For capability declarations, runtime outcomes, and console reporting, read Writing Boot Hooks.
Bootstrap Descriptors
Peios / Using Peios / Boot and Shutdown
A newly mounted filesystem needs access control before boot tools can use
it. The seed-sd helper establishes that initial security descriptor. Its
bootstrap policy gives SYSTEM and Administrators full access and adds an
inherit-only rule for the creator of each new object.
A template reaches later objects #
Inheritance applies the directory's template when a child is created.
Changing the directory later does not rewrite every existing child.
Prelude therefore calls seed-sd recursively on /dev, covering the nodes
already present as well as the directory that supplies later inheritance.
The walker writes a node's descriptor before inspecting its descendants. That order allows it to enter a directory whose missing descriptor would otherwise deny access. Symlinks receive their own descriptor; the walker does not follow their targets.
Bootstrap policy has a limited purpose #
The default is suitable for making a fresh tree administrable. It is not a complete access policy for a running system. Granting Everyone read access at the device root would also reach newly created raw disk nodes, where reading the disk can bypass file-level access control.
A caller that prepares a different tree can supply an explicit descriptor
with seed-sd --sddl. That caller owns the broader policy and its scope.
The command's options, required privileges, and exit statuses are recorded
in seed-sd(8).
Partial failure is visible #
Recursive seeding continues after errors where traversal remains possible. It reports failures and returns an unsuccessful status, but it does not undo descriptors already written. An installer or hook must use that status when deciding whether its own work succeeded.
The helper rejects command-line arguments containing invalid UTF-8 before applying any descriptor. During a recursive walk, a descendant name that cannot be represented as UTF-8 is reported as a failure and skipped.
Debugging Initramfs Boot
Peios / Using Peios / Boot and Shutdown
Use Prelude's recovery shell to inspect a boot that fails before the real-root init starts. A breakpoint lets you inspect or repair the temporary environment and then continue the same boot.
Before you start #
- Use a disposable test image or a machine you can recover independently.
- Have access to its boot parameters and boot console.
- Include
/usr/bin/shand the inspection tools you need in the image. - Treat the recovery shell as privileged access to the boot environment.
Stop before the hooks #
- Add
rd.breakto the image's kernel command line and boot it. - Wait for Prelude's breakpoint message and shell.
- Inspect
/system/preludeand the hook scripts named by its sequence. This breakpoint occurs before Prelude reads that sequence, so an edit made here takes effect when you resume. - Exit the shell to continue boot.
To stop before one hook instead, use rd.break= followed by its filename
or complete path. For example, rd.break=mount-root matches a hook whose
final path component is mount-root. Use the name present in your image.
The full syntax is in prelude(8).
Inspect a failure #
- Add
rd.shellto the kernel command line and boot the image. - Read the failure message before using the shell. A hook error identifies the failed hook; an unsatisfied capability identifies pending work.
- Inspect the files and mounts that remain at the point of failure. Before
handoff, the intended real root is
/mnt/rootfs. After a root switch, paths resolve inside the new root. - Exit when finished. A failure shell continues to the halt path, not back to the failed boot operation.
Check the result #
A successful breakpoint recovery reaches the real-root init. A failure
shell ends at the halt path after you exit. If no shell starts, look for the
reported exec error and check that /usr/bin/sh exists in the filesystem
visible at that stage.
Do not start the Prelude executable from an ordinary terminal to reproduce a boot problem. Its operations include mount changes and removal of files from the old root.
Writing Boot Hooks
Peios / Using Peios / Boot and Shutdown
A boot hook performs a deployment-specific part of early boot, such as
unlocking storage or mounting the real root at /mnt/rootfs. Prelude runs
the generated hook sequence before handing control to the real init process.
Put service startup and ongoing supervision in Peinit instead.
Before you start #
- Prepare an initramfs source tree and a disposable boot environment.
- Include each hook's interpreter, tools, and required drivers in that tree.
- Read
mkirf(1)for image construction and hook metadata syntax. - Arrange the access policy required by the storage operations you perform.
Hooks run under the bootstrap SYSTEM token. That authority does not remove kernel access checks or replace the security descriptors needed during boot. See Prelude for the stage's responsibilities and handoff checks.
Choose a location and declare dependencies #
-
Put a packaged hook under
usr/libexec/prelude/hooks.d/in the image tree. Put an operator-owned hook underlcl/libexec/prelude/hooks.d/instead. -
Give it a distinct filename, an available interpreter in its shebang, and executable permissions. An operator hook with the same filename replaces the packaged hook at image construction.
-
Declare its capabilities in a comment block:
#!/usr/bin/sh # /// hook # contributes = ["rootfs-ready"] # ///
This example declares part of the work needed for the real root. It is not a complete hook: append the required checks and operation before including it in an image. File extensions have no special meaning, and numeric prefixes are only filename tie-breakers, not a dependency mechanism.
Express what the hook needs and supplies #
The metadata distinguishes alternatives from work that must all complete:
| Declaration | Meaning |
|---|---|
provides | Any successful provider can satisfy the capability |
contributes | All contributors must complete their part |
requires | The capability must be achieved before this hook runs |
after | If supplied, wait for the capability's suppliers to settle |
after allows an optional milestone to be absent. It does not assert that
the milestone succeeded. Use requires when running without the achieved
capability would be incorrect. A capability cannot mix provides and
contributes suppliers.
Three shared milestones connect independently packaged hooks:
| Capability | Meaning |
|---|---|
initramfs-ready | The initramfs topology and console are usable |
rootfs-ready | The real root is mounted at /mnt/rootfs and ready for work |
rootfs-strata-ready | The StrataFS topology exists inside that root |
The builder orders declaring hooks after initramfs-ready unless they
supply it or already declare a dependency on it. An image without a supplier
does not gain a missing requirement from this implicit ordering. An explicit
requires retains its stronger meaning.
For example, an unlock hook and a root-mount hook can both contribute to
rootfs-ready. The mount hook can defer until the unlocked device exists.
This allows independent storage layers to compose without naming every
other hook. Where a prerequisite is known, declare it explicitly.
Return the right outcome #
| Exit | Meaning | Scheduler action |
|---|---|---|
0 | The hook completed its work | Record success |
69 | The hook has no applicable work | Record a deliberate decline |
75 | Inputs are not ready and nothing changed | Retry after other progress |
| Other | An attempted operation failed | Stop boot with the hook's failure |
A declining contributor has completed its part. A declining provider has not achieved its capability; another provider must succeed if a dependent hook requires it. Do not report success merely because the hook does not recognize the machine.
Check for readiness before making changes. Returning 75 promises that
retrying the hook does not repeat a partially completed operation. Once an
operation has been attempted and failed, return a failure instead of hiding
it as a deferral. Prelude stops when a full pass makes no progress while
work remains.
A hook killed by a signal fails. A hook stopped by job control is killed and reported as stopped; the boot environment does not provide an interactive job-control session to resume it. Failure does not roll back earlier hooks.
Selected root strategies should diagnose missing required inputs. The retained live-boot and disk-boot package recipes select one strategy through conflicting packages; they do not use runtime decline to choose between two broken configurations. A custom image needs its own explicit selection.
Report progress and failures #
Standard output and standard error go directly to the console. Prelude does
not capture and relabel each line. If the image supplies the level-three
prelude-hook-abi helper, source it and use your hook's own name:
Declare a dependency on prelude-hook-abi >= 3 when using this helper.
log_warn and log_fail write to standard error; the other functions write
to standard output. The helper observes the console color convention,
including TERM=dumb in the kernel command line.
Use a progress verb for work about to happen and a completed verb only after success. Logging failure does not itself replace returning a failure status. Do not log secrets used to unlock storage.
Build and check the result #
- Check shell syntax with the interpreter used by the image, then build the
archive with
mkirf. Resolve warnings about replaced or undeclared hooks. - Inspect the generated
/system/prelude/hooks.seq.<n>files in the image. Confirm the chosen paths and capabilities. Do not edit generated sequences. - Boot the disposable image. Exercise success, inapplicable hardware, missing inputs, deferred work, and operation failure.
- Confirm that
/mnt/rootfsis a separate mounted filesystem and that the expected init process starts after handoff.
Prelude reads the newest supported sequence version. An unsupported version
produces a warning when a supported fallback exists, or an error when none
exists. The warning remains visible at peios.quiet=2. A missing sequence
is an error; an intentionally empty manifest is distinct from a missing one.
Malformed selected manifests also fail rather than silently rescanning hooks.
For discovery and dependency validation during image construction, see Building an Initial RAM Filesystem. A successful archive build does not establish that its tools, policy, or storage configuration can boot.
Building an Initial RAM Filesystem
Peios / Using Peios / Boot and Shutdown
mkirf builds an initial RAM filesystem, or initramfs, from a source
directory. The kernel unpacks that archive to provide files needed before the
final root filesystem is ready.
Source files and generated order #
Source-tree contents map onto the archive's root. The tree needs an executable
init and supported entry types. Sockets and preexisting generated
hook-sequence files are rejected.
Packaged hooks and operator-provided hooks can declare dependencies. Operator
hooks take precedence when filenames match. The builder resolves those
declarations into a valid order and emits versioned sequence files under
/system/prelude without writing them into the source tree.
A missing required capability or a cycle prevents a valid order. A hook without metadata is handled separately, with a warning and a defined late-order position. Do not mistake that compatibility path for dependency validation.
Determinism is an archive property #
The builder sorts entries and normalizes metadata that would otherwise vary between runs. Regular-file executability remains significant, while ownership, timestamps, and archive inode numbers are normalized.
Compression settings also form part of the result. The default uses zstd; gzip is available for a kernel without support for the default format. Compare builds made with the same inputs, settings, and implementation. A deterministic archive does not itself prove a bootable or trusted image.
Early segments precede compression #
The kernel reads some content before it decompresses the main archive: CPU
microcode and ACPI table overrides. This content forms the early part of the
initramfs. Packages place it in /usr/lib/earlyirf/, and an administrator
can place it in /lcl/lib/earlyirf/. Each child directory is one segment,
and its contents map onto the archive root. For example,
/usr/lib/earlyirf/intel-ucode/kernel/x86/microcode/GenuineIntel.bin
becomes kernel/x86/microcode/GenuineIntel.bin.
A segment in /lcl/lib/earlyirf/ replaces the segment of the same name in
/usr/lib/earlyirf/, and mkirf warns about the replacement. mkirf still
reads segments from the old ++ directory at the root of the tree and warns
about each one.
The segments are combined into an uncompressed early archive ahead of the main archive, which does not hold them. Conflicting entries are rejected rather than silently choosing a copy.
Watch mode is a build loop #
Watch mode builds once, then waits for source changes to settle before rebuilding. A failed rebuild is reported while the watcher remains available for a later correction. Keep the output outside the watched tree to avoid triggering a rebuild with its own output.
Successful writing replaces the output through a sibling temporary file. That protects against presenting a partial assembled archive; it is not a boot test or a full power-loss durability guarantee.
mkirf(1) defines source layout, hook rules, metadata normalization,
compression, exclusions, and watch behavior. Validate the resulting image in
the boot environment before selecting it for deployment.
Hook discovery and validation #
The builder scans regular files directly inside usr/libexec/prelude/hooks.d
and lcl/libexec/prelude/hooks.d in the source tree. It does not recurse into
subdirectories or select a particular extension. A filename identifies one
hook; an operator copy wins over the vendor copy, with a diagnostic naming
the replacement. The legacy root-level hooks directory is accepted with
migration warnings.
A hook's metadata opens with exactly # /// hook and closes with # ///.
Between those lines, each line is a comment. The supported keys are
provides, contributes, requires, and after, each holding a list of
double-quoted capability names. Empty lists and trailing commas are accepted.
This is a restricted declaration format, not arbitrary TOML.
Unknown keys, malformed lists, duplicate or unclosed blocks, missing required capabilities, dependency cycles, and mixed provider/contributor definitions are build errors. A declared empty block differs from having no metadata. Undeclared hooks are warned about and placed after declaring hooks.
Dependency edges place suppliers before consumers. Filename order breaks
ties between unrelated hooks. The builder materializes implicit
initramfs-ready ordering in the generated manifest, retaining an explicit
requires instead of weakening it to after. Prelude then consumes that
manifest; it does not rediscover or reorder the source directories at boot.
Writing Boot Hooks explains capability achievement, decline, deferral, and console reporting. Image construction checks declarations; boot testing checks whether those claims match the hook's behavior.
Assembling a Unified Kernel Image
Peios / Using Peios / Boot and Shutdown
mkuki assembles a unified kernel image (UKI). It appends a kernel, an
initramfs, and a command line to a firmware executable stub so that the boot
payload travels as one file.
Three payloads and a stub #
The command line, kernel, and initramfs occupy separate named sections in the executable. The stub reads those sections at boot. The default stub is bundled into the utility; its provenance can be inspected separately.
Command-line input can come from a literal value or a file. Trailing line endings are removed and a terminator is added. Embedded zero bytes are rejected rather than silently shortening the command line.
Select a kernel image #
A concrete image path selects exactly that file. Directory selection reads
vmlinuz directly in the selected directory, normally /usr/lib/modules.
A Peios system closure has one kernel, at /usr/lib/modules/vmlinuz, with
modules in the same directory and no release subdirectory.
Directory selection reads the image again after a directory changes. A missing image makes that rebuild fail while leaving the watcher available to retry.
Publication and signing are separate #
The assembled image is written through an exclusively created sibling temporary file and then replaces the output. A failed staging write does not replace the accepted output with a partial assembly.
The command does not sign the image. A complete firmware executable is not proof that its payloads are trusted or bootable. Signing, trust policy, and boot qualification are separate steps.
Watch the inputs without watching the output #
Concrete input files are observed through their parent directories so that atomic file replacement is visible. Directory selection watches the selected directory nonrecursively. Output paths that feed back into those watched locations are rejected.
After changes settle, the watcher rebuilds. Failure is logged rather than ending the loop, so the last output can remain older than the inputs. Monitor diagnostics instead of treating the existence of an output file as proof of a successful latest build.
mkuki(1) defines section construction, kernel selection, stub inspection,
watching, and output failures.
Applying a Root Skeleton
Peios / Using Peios / Boot and Shutdown
skeleton apply makes the directories and links a root needs outside /usr.
Packages only install under /usr, so /var, /lcl, /tmp and the /lib64
link to the dynamic loader come from a root skeleton file instead. The
dev.peios.fsbase package ships that file at /usr/share/skeleton, and
whatever builds a root applies the copy in that root's own /usr.
The live-boot hook runs this after composing the live root. An installer or an
upgrade tool runs it against the root it builds. --file applies another file
instead of the root's own, and --verbose prints each entry it makes.
Making what is missing #
skeleton reads and checks the whole file, including every security
descriptor, before it changes anything. A file with an error changes nothing.
It then works through the entries in order. It makes each missing directory or link, and leaves each existing one alone, even if its security descriptor differs from the file's. Running it again makes nothing new.
It stops with an error when something of another kind is in an entry's place, such as a file where a directory belongs, or a link with a different target. It never follows a link to reach an entry. Entries made before the error stay, so you can run it again after removing what was in the way.
Descriptors at creation #
A directory with a descriptor in the file is created with that descriptor in the same native create call. It never exists with an inherited descriptor first. A directory without one inherits from its parent.
A descriptor doesn't need to grant whoever applies the skeleton any access. The create succeeds even if the new descriptor would deny its creator.
The file's format is specified in PSPU 11.
Shutting Down and Rebooting
Peios / Using Peios / Boot and Shutdown
Use svctl shutdown when you intend to stop the machine. Choose one action:
These are alternatives, not a sequence. Each interrupts running services and
jobs and requires SYSTEM_SHUTDOWN. Save work and account for other users
before issuing one. halt stops the CPU but leaves power on.
A normal shutdown stops dependents before their dependencies, gives running services time to exit, then unmounts, syncs, and performs the selected action. Forced shutdown skips that opportunity to finish work.
How shutdown is triggered #
There are four paths into shutdown, and they are not equal — three are graceful, one is not.
A control command. An administrator with SYSTEM_SHUTDOWN runs
svctl shutdown <type> (the familiar reboot, poweroff and halt
commands, and shutdown -r now, are the same client under other names):
| Type | Result |
|---|---|
poweroff | Stop everything, unmount, power off. |
reboot | Stop everything, unmount, reboot. |
halt | Stop everything, unmount, halt (CPU stopped, power stays on). |
Signals. As PID 1, peinit treats a handful of signals as shutdown requests:
| Signal | Meaning |
|---|---|
| SIGINT | Reboot — the kernel sends this on Ctrl-Alt-Del. |
| SIGTERM | Poweroff. |
| SIGPWR | Poweroff — a compatibility path for environments that surface power failure or power-button policy as a signal. |
The power button. On Linux, a physical power-button press is a graceful
poweroff — peinit watches the machine's input devices under /dev/input and
treats a KEY_POWER press (the key going down, not its release or
auto-repeat) as a shutdown request. This path is deliberately minimal and
fail-soft: if /dev/input is missing, an input device cannot be opened,
or a device stops responding, peinit keeps running and drops that device — the button quietly stops working, but the machine stays up and you can still
shut down over the control socket or with a signal. It is not a full
power-management policy engine; a separate power-management daemon can add
richer policy on top by sending control-socket commands.
A Critical service failure — the ungraceful path. When an
ErrorControl=Critical service exhausts its restart
budget, peinit syncs and reboots
immediately. There is no service-stop ordering: the system is in an
undefined state and the fastest route to a known one is a reboot. This is what
feeds the boot-attempt
counter, and a Critical service
that fails identically every boot becomes a reboot loop that the counter
eventually breaks by escalating to Recovery.
The graceful sequence #
For a poweroff, reboot, or halt, peinit runs an ordered sequence:
- Enter the shutdown state. A flag is set, and while it holds: no new
services can start, timer triggers are disarmed, and new lifecycle
commands are rejected with
INVALID_STATE. Status, list, operation-status, boot, and job query/stop commands remain available so you can watch progress or stop a job sooner. - Suspend Critical-failure semantics. If a Critical service fails during shutdown, it is logged but does not trigger a reboot — the system is already going down, and rebooting would loop.
- Clear Completed services. Oneshot services sitting in
Completed (with
RemainAfterExit) have no process; peinit moves them to Inactive so their dependents can be stopped cleanly. - Stop every live submitted
job at once — SIGTERM,
then SIGKILL of the job's cgroup after its own
stop_timeout— and cancel any job still queued to launch, both with causeshutdown. Jobs have no dependencies, so there is no order among them and nothing waits for them to finish before the service waves begin; but shutdown does not complete while a live job remains, within the same global timeout. - Stop services in reverse dependency order, in waves. Each
graceful-stop-eligible service (those in Active or Reloading) gets SIGTERM
and
StopTimeoutseconds to exit; if it does not, peinit SIGKILLs its whole cgroup. A service is never stopped until everything thatRequiresorBindsToit has already stopped. Services that are Starting are not stopped gracefully — their startup is canceled and the cgroup SIGKILLed. - Enforce the global timeout. The whole sequence is bounded by
ShutdownTimeout(default 90 s). When it expires, all remaining services are SIGKILLed; any whose cgroups do not empty within the post-kill timeout (default 5 s) become Abandoned (leaked), and shutdown continues regardless. - Save the random seed. With every service stopped and before any
filesystem is touched, peinit writes a fresh seed drawn from the kernel's
CSPRNG to
/var/state/peinit/random-seed— this is the entropy the next boot starts from. The write is crash-conscious (written to a temporary file, flushed, then atomically swapped in), and it is best-effort: if it fails, peinit logs it and carries on. Shutdown never stalls on it, and the forced and Critical-reboot paths skip it entirely in favor of getting the machine down fast. - Unmount filesystems. peinit snapshots the mount table and tries to
unmount every remaining non-root mount in its namespace — not only the
ones it mounted itself — working from the deepest mount points outward.
That includes the Phase 1 set (
/proc,/sys,/dev,/dev/pts,/dev/shm,/run,/sys/fs/cgroup) wherever those are still mounted. A mount that is already gone counts as done. If one won't unmount because it is busy, peinit falls back to remounting it read-only; anything it still can't clean up is logged and left for the finalsync()and the kernel, never blocking shutdown. The root filesystem (/) is never unmounted — once the rest are handled, peinit remounts root read-only. - Sync and finish.
sync()to flush pending writes, then the final action — power off, reboot, or halt.
The reverse ordering falls straight out of the dependency
graph; there is no separate stop-order
configuration. Shared platform services stop after their dependents, with
registryd last. The exact order is derived from the installed graph.
STOPPING=1 and timeout extension #
A service that begins shutting down on its own — say, in response to an
internal error — can tell peinit by sending STOPPING=1 through
sd_notify. peinit acknowledges it
and, importantly, stops sending SIGTERM to that service: it is already on
its way down, and a redundant signal could interfere.
STOPPING=1 is a courtesy, not a timeout extension. The StopTimeout
keeps running; if the process has not exited when it expires, peinit escalates
to SIGKILL regardless. A service that genuinely needs longer must say so with
EXTEND_TIMEOUT_USEC (see Keeping services
running) — and during shutdown those
extensions are capped not only by the per-service StopTimeout × 4 but also
by the remaining global ShutdownTimeout, whichever is smaller.
Forced shutdown #
When the machine must be stopped despite a stuck graceful shutdown, repeated SIGINT forces it: three Ctrl-Alt-Del presses within five seconds skip the graceful sequence entirely — SIGKILL everything, sync, reboot. It is the escape hatch for a graceful shutdown that is itself stuck behind an unresponsive service.
Shutdown during boot #
A shutdown requested while peinit is still in Phase 2 boot takes effect immediately: services still Starting are SIGKILLed (they never reached Active, so there is nothing to stop gracefully), services that did reach Active are stopped per the normal sequence, and the boot is abandoned.
How peinit handles signals #
peinit handles all signals through a signalfd read from its event loop —
every signal is blocked and read as data, so there are no async signal
handlers and no async-safety hazards. PID 1 cannot be killed by any signal;
the kernel protects it.
| Signal | Behavior |
|---|---|
| SIGCHLD | Reap children; match exits to services and submitted jobs. Also reaps orphaned processes the system reparented to PID 1. |
| SIGINT | Reboot request. Repeated within the window → forced reboot. |
| SIGTERM | Poweroff request. |
| SIGPWR | Poweroff request — compatibility path for power-button/power-failure policy. |
| SIGHUP | Ignored — PID 1 has no controlling terminal. |
| SIGPIPE | Ignored — a broken control-socket pipe must never crash PID 1. |
All other signals are ignored.
Where to start #
To understand the reverse ordering and which relationships gate it, read Dependencies and ordering.
To understand the Critical-failure path that bypasses graceful shutdown, read Keeping services running.
For the boot side of the lifecycle and the reboot/recovery escalation, read Boot and boot modes.
The Registry
Peios / Using Peios / The Registry
The registry is where Peios keeps configuration: service definitions, network profiles, sign-in policy, desktop preferences, and the settings of almost every component. It is a tree of keys holding typed values. The kernel decides who can read or change each key. It also lets an installed role, a policy, and an administrator each set the same value without overwriting one another. Understanding that model explains why a value you set might not be the one in effect.
Hives, keys, and values #
A path through the registry names a key, from the top of the tree down:
Machine\System\Services
The first part of every path is a hive, a top-level tree. A standard system has two:
Machineholds settings for the whole machine.Usersholds one subtree for each account, named by the account's security identifier (SID):Users\<SID>.
CurrentUser is a shortcut, not a third hive. At the start of a path, it
stands for Users\<SID> of the account the calling program runs as. Other
components can register further hives.
A key contains subkeys and values. A value is a named piece of data with a type. A key can also have one value with an empty name, its default value. The types you meet most are:
| Type | Holds |
|---|---|
REG_SZ | A UTF-8 string |
REG_MULTI_SZ | An ordered list of strings |
REG_DWORD | A 32-bit unsigned integer |
REG_QWORD | A 64-bit unsigned integer |
REG_BINARY | Raw bytes |
Names are case-insensitive but keep the case they were created with, so
Machine\System\Services and machine\system\services are the same key. The
backslash is the separator. Tools also accept a forward slash, which is easier
to type in a shell.
Layers #
Each value can have several entries at once, one from each layer that has set it. A layer is a named collection of registry writes that can be managed, and removed, as a unit. When a program reads a value, the kernel returns the single winning entry: the effective value.
Two numbers decide the winner:
- Precedence. Every layer has a precedence. The highest precedence wins.
- Sequence. Among layers with the same precedence, the most recent write wins.
The base layer is built in and is always present. It has precedence 0,
and a write that names no layer goes to it. Layers that a role installs also
sit at precedence 0, so the most recent write among them wins. Policy layers
sit above 0 and override both. Giving a layer a precedence above 0 requires
SeTcbPrivilege; being a local administrator doesn't grant it on its own.
Layers make configuration reversible. Deleting a layer removes its entries, and the next entry down becomes effective again. A layer can also mask a value, so that the value reads as absent while the layer is in effect.
When a read seems wrong, check which layer won. reg and Registry Editor
both report the winning layer for each value.
Who stores the registry #
The kernel holds none of the registry's data. Programs called sources
store it, and the kernel asks them for entries when it needs them. On a
standard system, the source is loregd, which keeps the Machine and
Users hives in database files under /var/state/loregd.
The kernel makes every decision: which layer wins, who can see a key, and who can change it. A source only stores what it is given. Programs reading and writing configuration always talk to the kernel, never to the source.
A key can be volatile, which tells its source not to keep it in permanent storage. loregd holds volatile keys in memory-backed files, so they disappear whenever loregd restarts, even if the machine doesn't.
If a source stops, its hives become unavailable and requests for them fail until it returns. Sign-in and other services depend on the registry, so a storage failure can affect much of the system. Diagnosing Registry Storage Failures covers recovery.
Who can read and change a key #
Every key has a security descriptor, which records who owns it and who can do what to it. The kernel checks the descriptor once, when a program opens the key, and the program keeps the access it was granted for as long as the key stays open. Values don't have security descriptors of their own: the key's descriptor covers all of them.
The kernel checks only the key being opened, not the keys above it. A program
can open Machine\System\Services\netd without any access to
Machine\System\Services.
Changing a key's security descriptor doesn't affect programs that already have it open. Security descriptors aren't layered either, so removing a layer doesn't undo a change to one.
Documentation and live state #
Each component installs a manual for the registry settings it owns. regman
reads those manuals. It tells you what a value means, which values are valid,
and when a change takes effect, but it doesn't read the live registry. Use
reg or Registry Editor to see what is actually set.
Storing a value doesn't prove that its component accepted it. The component that reads a setting checks it and decides when to apply it, so check that component after a change.
Where to start #
These pages cover the tasks:
- Finding a Registry Setting to find the owner and live state of a setting before you change it.
- Changing a Registry Setting to make a change from the command line and confirm that it applied.
- Registry Editor to browse and edit the registry on the desktop.
- The SDK's Registry Overview to use the registry from your own code.
Registry Reads, Writes, and Layers
Peios / Using Peios / The Registry
reg reads and changes the live registry. regman explains the intended
meaning of a setting; it does not read the value configured on this machine.
Consult the documentation before changing a setting whose accepted values you
do not know.
Keep the key and value name separate #
The key path and the value name are separate arguments. A value name can
contain separators that are not allowed inside a key-path component. The
special value-name token @ selects the empty-name default value.
Value literals have types. Numeric-looking input can be inferred as a number, losing a textual spelling such as leading zeros. Use an explicit string type when those characters are part of the value's meaning. Inspect the resolved type reported after a successful write.
The empty-name default value is unrelated to a consumer's documented
fallback when an entry is absent. To preserve text such as 007, use an
explicit literal such as sz:007. Quote backslash paths in a shell, or use
forward slashes. reg(1) owns the full type-prefix and encoding reference.
Names preserve display case and compare without locale-sensitive case rules. They are not Unicode-normalized, so visually identical names can remain distinct. Ordinary value data is opaque to the registry; its consumer checks whether the bytes make sense for the type and setting. A link key's target has additional interpretation by the kernel.
A volatile key describes storage lifetime, not when a setting applies. Check
reg info for volatility and the setting's manual for application timing.
Choose a layer deliberately #
An effective read resolves the visible value across layers. Deleting an entry in one layer can reveal a lower entry. Masking hides lower values instead, while hiding a key affects path visibility.
These are different operations, not interchangeable ways to remove data. Select the layer and understand the lower state before changing either. Security-descriptor changes affect the key object directly; removing a configuration layer does not undo them.
The winner has the highest precedence, then the newest write sequence within
that precedence. A sequence is not a timestamp or a history of previous
values. Base and role layers can share precedence zero; writing to base does
not prevent a later role update from winning. reg get KEY NAME -L reports
only the effective winner, not every hidden entry.
See Recovering a Registry Layer before disabling or removing configuration, and Removing Registry Entries before choosing between withdrawal and masking.
Separate exchange from exact backup #
JSON export and apply provide a reviewable representation of keys and values. A batch applies within one hive transaction. It is not a cross-hive transaction. Export does not claim to preserve every security component.
Text export is useful for review, but the text import path is not implemented. Use the supported JSON document when applying an export. Opaque backup and restore use a different kernel mechanism and require the corresponding privileges.
Use Applying a Registry Batch for related edits and Backing Up Registry Configuration for recovery.
Treat notifications as prompts to reread #
A registry watch tells you that relevant state changed. Reread the state needed by your application; do not treat the notification itself as the complete new configuration.
For an operator watch, run this in a terminal and read the current values from another:
The watch command remains running until interrupted; the second command is a separate read. Watch permission does not grant permission to read descendant values. The command reports changes without decoding every detailed record.
Watches describe effective-state changes, not every hidden layer write. After overflow, an interruption, restore, or source reconnection, read the required key or subtree again. A watch follows its opened key object; if a replacement key takes the same path, reopen the path and arm a new watch. Uncommitted transaction changes are not consumer notifications.
Operations use the caller's authority. Interactive confirmation protects
against mistakes but is not an access check, and redirected input can change
prompting behavior. reg(1) defines types, layers, batch syntax,
confirmation, and status codes.
Inspect a link rather than its target #
Normal opens follow registry links. To inspect a suspected link itself,
replace KEY with its path:
Check the link flag and the winning unnamed target value. A link flag is
fixed at creation; storing REG_LINK in an ordinary key does not create a
link. Conversely, a winning value of the wrong type can break resolution of
a flagged link. A target is literal: CurrentUser is not expanded inside it.
Targets are layered, so withdrawing a target entry can reveal a different
one. Check both the stored target and the resolved object after repair.
reg(1) defines which mutating commands support operating on a link itself;
do not assume every command accepts the inspection options above.
Diagnose access to a key and a layer #
A write needs the key's operation rights and access to its destination
layer. Use reg sd for the key's owner, group, and DACL; reading its SACL
needs ACCESS_SYSTEM_SECURITY. Values have no separate descriptors.
Inspect layer metadata permissions as well as the target key. Its Owner
value is informational, not an authorization grant. Creating or promoting a
layer above precedence zero needs SeTcbPrivilege. Merely being a local
administrator does not establish that privilege.
Do not create Machine\System\Registry\Layers\base as an exploratory
repair. Without that metadata key, a compiled descriptor allows
Authenticated Users to write into base, subject to target-key access.
Creating the key replaces that fallback with its real descriptor; inherited
read-only grants can unexpectedly prevent personal configuration writes.
A parent's readability does not establish a child's permissions, and LCS does not apply filesystem-style traverse checks to each path component. Inheritance applies when a key is created. Editing a parent's descriptor does not rewrite existing descendants or revoke rights on existing handles. Reopen the key when testing a changed descriptor. The kernel's access flow and layer authorization references define the checks.
Finding a Registry Setting
Peios / Using Peios / The Registry
Find a setting by its purpose and consuming component. A path can contain operator configuration, a runtime observation, or personal preferences; those are different kinds of data.
Find and inspect #
-
Search installed manuals with a term from the setting's purpose:
-
Read the matching key and value documentation. Confirm its owner, scope, type, accepted values, and application timing.
-
Inspect live state with
regor Registry Editor. Keep the key path and value name separate. A documented default can apply even when no live entry exists; do not create one solely because it appears in the manual. -
Follow Changing a Registry Setting when the intended change and recovery are understood.
Common owners #
| Purpose | Starting location | Owning guidance |
|---|---|---|
| Service definitions | Machine\System\Services | Service configuration |
| Boot and init settings | Machine\System\Init | Boot modes |
| Network profiles and reported state | Machine\System\Network | Profiles and name resolution |
| Shared authentication grants | Machine\Generic\Authn\Policy | Granting Access |
| authd source registration | Machine\Software\Authd\Sources | Registering a Principal Source |
| Personal preferences | Users\<SID> | The component consuming the particular key |
This is an orientation map, not a complete schema. A shared format under
Machine\Common, such as SecurityDescriptorBuilder, is still defined by
its consumers' documentation; it is not automatically part of a specification.
Use the installed manual for the specific value.
Identity and reported state #
CurrentUser is an alias resolved from the calling thread's effective token.
A service or impersonating thread can therefore address a different account
from an interactive shell. The kernel's hive routing
reference defines the
alias's limits. It is not a separate hive or a universal substitution inside
every stored string.
Machine-to-user fallback is consumer-specific. Session locales combine corresponding machine and personal values; that rule does not apply to unrelated settings.
Services also publish facts. For example, netd's status and readiness describe observed network state. Change its documented profiles to request behavior; do not edit a reported address and assume that it configures an interface. Remembered DNS observations are distinct from active resolver state and configured resolver overrides.
Missing or unreadable #
A missing manual entry can mean documentation is absent. A missing live value can select a documented fallback. Access denied means the caller lacks the right for that operation; listing a parent does not establish access to a child's contents.
Check the actual descriptor. There is no universal rule that every registry key is readable by everyone, and knowing a path grants no access to it.
Finding a Setting's Meaning
Peios / Using Peios / The Registry
regman reads the documentation shipped for registry settings. It explains
what a key or value means, what values are accepted, and which component owns
it.
Documentation and state answer different questions #
A documented default is not necessarily the value configured on this machine.
regman does not query the live registry. Use reg for the effective value
and its available provenance.
The component that consumes a setting decides whether it is meaningful. Successfully storing a value does not establish that the consumer accepted it. Read the setting's type, range, and application behavior first.
Start with a name or a search term #
An exact key and value lookup is useful when an error names the setting. A key lookup groups its documented values, while a search finds names and summaries when you know the subject but not its location.
Some components document a family of keys using wildcard paths. An exact record is more specific than a matching family description. Read the resolved path so that you know which documentation answered the query.
Installed packages supply the corpus #
Packages place their registry manuals under /usr/share/regman. A missing
entry can mean that documentation is absent; it does not establish that the
live key is absent. Overlapping definitions are reported rather than silently
treated as one authoritative record.
The lookup index is an accelerator. Invalid indexes fall back to reading the manuals instead of serving unchecked index data. Authors can format, lint, and rebuild the index as part of preparing a package.
regman(1) defines lookup, search, path selection, and authoring commands.
Changing a Registry Setting
Peios / Using Peios / The Registry
A registry write changes stored configuration. Its consumer still decides whether the data is valid and when to apply it. Verify both storage and behavior before treating an edit as complete.
Before you start #
Find the owning component and confirm that the value is configuration rather than a reported fact. You need access to the exact key and the destination layer. Keep a working route to the machine if the change affects access.
Read the setting's registry manual. Record its type, valid range, default,
and application timing. regman reads installed documentation, not live
state. A missing manual entry is not permission to try arbitrary values.
Inspect, change, and verify #
-
Inspect the setting and its manual. For example, these commands read the kernel event-buffer setting without changing it:
-
Record the current type, effective value, winning layer, and sequence. If the value is absent, record that instead.
-Lshows the winning entry; it does not enumerate every entry hidden beneath it. -
Prepare recovery appropriate to the change. A JSON export is useful for review but does not preserve everything an opaque registry backup does. Include permissions and layer definitions when recovery depends on them.
-
Write the intended value with an explicit type and destination layer. For example, only after confirming that an 8 MiB event buffer is the intended configuration:
-
Check the effective value and type. Follow the manual's application point: a live change, service restart, or reboot. Inspect the consumer's state and events, then test the behavior the change was intended to alter.
The desktop equivalent is Changing Registry Values. It still requires the same choice of layer and separate consumer check.
Interpret a different result #
A higher-precedence layer can keep a successful write from becoming the winner. At equal precedence, write order chooses the effective entry. Do not repeat base-layer writes to try to override stronger policy.
A conditional write checks the destination layer's entry. A sequence reported
for a winner in another layer is not a version of the entry you intend to
change. Read reg(1) before using --expected-seq in automation.
A watch notification reports a registry change, not consumer acceptance. Some consumers reject invalid configuration and keep their last valid state; others have a documented compiled fallback. Read the component's rule and rejection diagnostic. Do not assume every component repairs, clamps, or resets a value in the same way.
Recover and check again #
After a timeout or source failure, read back inspectable state before retrying. A dispatched write or commit can have succeeded despite a lost reply.
Restore the intended entry in its intended layer, or withdraw that layer's entry through the supported tool. Deletion can reveal a different winner rather than select a compiled default. Removing a layer does not restore a key's previous security descriptor or undo actions a service already took.
Repeat both the stored-state check and the consumer check after recovery. If storage is unavailable, start with registry storage failure diagnosis instead of editing backing databases.
When two readers see different state #
Compare effective thread credentials before comparing registry results. A private hive can shadow the global hive, and a privately attached layer can remain active when disabled globally. Impersonating threads in one process need not share a view. An administrator's global read or backup therefore need not describe a sandbox's private configuration.
The kernel defines private hive routing
and private layer attachment.
The workload's isolation mechanism controls these attachments; reg does
not manage them. Limits on scopes and layers can also reject an operation
without a key-permission failure.
Registry Editor
Peios / Using Peios / The Registry
Registry Editor displays keys, values, and their registry documentation. A key is a container; a value is named data with a type. The editor reads as your account and distinguishes unavailable access from an empty key.
The tree starts at Machine, Users, and CurrentUser. A direct path can reach a readable child even when you cannot list its parent. The detail pane shows a value's data, type, size, and winning layer, or information about the selected key.
Stored data and documented defaults #
The registry manual supplies descriptions, expected types, defaults, and application timing. Documented values absent from the key are shown as Not set. These are explanatory entries, not stored data or exported values. A type mismatch or malformed value is shown instead of being silently repaired.
A saved registry value can still be rejected by its consuming component. Follow its manual and inspect its status after a change.
Layers #
Writes go to selects the destination layer. A value's displayed winner can come from another layer. Writing a lower layer does not displace an entry with higher precedence. Deleting a value removes the selected layer's entry, so another entry can become visible instead of the value becoming absent.
Layer management changes whole sets of entries. Positive precedence needs
the operating-system privilege SeTcbPrivilege; being an administrator is
not sufficient by itself. Key owners and permissions are not layered:
disabling a layer does not undo a descriptor change.
Export and backup #
Export creates a reviewable registry document of keys and values. Back up includes security descriptors and tagged layer entries. They are not interchangeable recovery formats. A backup's layer manifest does not recreate missing layer definitions on its own.
Import writes the selected document into the chosen layer in a transaction. Restore replaces the target's contents and subtree, including its descriptor, rather than merging into the current contents. Backup and restore have their own privilege requirements.
For a controlled edit, follow
Changing Registry Values. The command
reference is gxwi-registry-editor(1); the registry's shared semantics
remain owned by its own documentation.
Changing Values in Registry Editor
Peios / Using Peios / The Registry
A registry edit changes stored configuration. To establish that the change worked, verify both the resulting entry and the component that reads it.
Before you start #
You need Registry Editor and access to the exact key and destination layer. Record the existing value, type, layer, and relevant permissions. Choose an export or backup suited to the recovery you need.
Edit one value #
- Open Registry Editor and navigate to the key, or enter its path and select Go.
- Select the value and read its registry manual, including valid values and when a change takes effect.
- Check Writes go to. Confirm the selected destination even when a different layer supplies the displayed value.
- Open Edit, enter the intended data, and select Save. For a documented but absent value, use Set.
- If the editor reports a concurrent change, refresh and inspect the new state before submitting another edit.
Check the result #
Use Refresh or F5. Inspect the value, type, and winning layer. Then inspect the consuming component at the time its manual requires. A conditional write protects the destination layer's entry, not every possible change to a winner in another layer.
Deleting and recovering #
Deleting a key removes its subtree in one transaction or fails. Large subtrees can exceed transaction or open-handle limits. Agree the intended smaller scope before splitting a failed deletion, because several transactions are not one atomic operation.
Deleting a value can reveal a surviving entry from another layer. A saved change or deletion does not by itself select the consumer's compiled default.
Read an import or restore target before confirming it. After a timeout or source failure, inspect current state before retrying: an error alone does not prove that a transaction was rolled back. Changing permissions affects future opens; existing handles retain rights already granted.
Changing System Settings
Peios / Using Peios / The Registry
System Settings changes machine-wide time, locale, startup, and identity settings. Personal account choices belong to My Settings, and shell appearance belongs to Desktop Settings.
Before you start #
You need access to write the relevant registry key or configuration file. Some immediate operations also require a daemon control right. Record the existing setting before a change that needs a restart or affects access.
Change a setting #
- Open System Settings and choose the relevant section: Time & Date, Language & Keyboard, Startup & Shutdown, or About.
- Inspect the current value and its scope. A switch or list choice applies when selected; typed values use the associated Apply, Save, or Set Clock action.
- Make one intended change and read the status line. A refused immediate choice is put back.
Check the result #
The window rereads state every five seconds. Verify the consuming service or the next session as appropriate, not only the stored field.
Time settings are read by timed; setting the clock manually needs its control right and automatic time disabled. Console keyboard changes try to restart the keymap service when permitted; otherwise they take effect at boot. Machine locale defaults affect new sessions. The machine name is applied by netd.
Startup settings include peinit stage timing, console automatic sign-in,
and selected kernel-command-line options when dynamic boot is available.
Changing the next boot image's inputs does not change the running kernel.
See gxwi-system-settings(1) and each setting's registry manual.
The language and format selections save LANG with the time, number, money,
measurement, and paper categories. Use reg when changing one independently
configured category. For personal precedence and new-session checks, follow
Choosing Session Locales.
Removing Registry Entries
Peios / Using Peios / The Registry
Decide whether the intended result is to withdraw one layer's contribution or make a name absent despite contributions beneath it. These are different operations.
Choose the operation #
| Intended result | Operation |
|---|---|
| Withdraw a layer's value entry | reg delvalue |
| Keep a value absent over lower entries | reg mask |
| Withdraw a layer's key-existence claim | reg delkey |
| Hide a key over lower claims | reg hidekey |
| Remove the corresponding absence marker | reg unmask or reg unhidekey |
reg mask --all creates a blanket value mask. It does not delete every
stored value. Use reg(1) for exact arguments and layer selection.
- Inspect the target and winning layer, then save the recovery data needed for that scope.
- Select the destination layer explicitly. Do not assume withdrawing its entry makes the name absent: another layer can become visible.
- Run the operation appropriate to the intended result.
- Reopen the path, inspect the effective state, and verify the consumer. Removing an absence marker can reveal data that has changed since masking.
Key deletion requires key deletion rights; value changes need value-write rights. Both also require applicable layer access. Hive roots cannot be hidden or deleted through these operations.
Recursive removal and existing handles #
reg del -r uses one transaction and does not follow registry links during
its recursive walk. Resource and transaction limits still apply; a large
walk can fail. Terminal confirmation is not shown with redirected input.
A lost commit reply leaves the outcome uncertain. Read state before retrying rather than assuming nothing changed. Existing handles can continue to refer to an orphaned key after its path disappears. A replacement at that path is a different object; reopening is necessary to inspect or watch it.
Applying a Registry Batch
Peios / Using Peios / The Registry
Use a reviewed JSON registry document when several entries must become visible together. A transaction provides registry atomicity, not simultaneous application by every service that consumes the settings.
Review, apply, and verify #
-
Review every operation and its destination layer. All operations must target one hive, even when several hives share one source. Descriptor changes are security changes and require their own review and rights.
-
Save recovery data appropriate to the changes. A JSON export contains visible keys and effective values, not every descriptor or layer entry.
-
Apply the document:
-
Inspect the affected entries and verify consuming services. If a commit times out or loses its source reply, inspect state before resubmitting: storage can have committed despite the reported failure.
Text export is for review; text batch input is not implemented. reg(1)
defines the supported document schema.
Boundaries of the transaction #
reg apply --dir DIR applies each file as a separate transaction. A directory
import is not one atomic unit. Transactions have bounded time and size, no
nesting or savepoints, and require source support. Splitting a failed batch
can break the consistency requirement that motivated it.
Readers outside a transaction do not see its intermediate writes. Bound
reads see that transaction's pending changes. This does not provide
value-level conflict detection: if a write depends on an unchanged entry,
use --expected-seq with the destination layer's own sequence. reg get -L
only exposes that sequence when the destination is the effective winner.
A layer makes entries removable later; a transaction publishes related changes together. Neither is an undo history, and removing a layer does not reverse descriptor changes. A late successful commit can still notify watchers after the caller's timeout. Closing an uncommitted transaction aborts it, but cannot undo an already-dispatched successful commit.
Backing Up Registry Configuration
Peios / Using Peios / The Registry
Choose the format according to the recovery requirement. JSON exchange and opaque registry backups preserve different information.
| Need | Mechanism | Limit |
|---|---|---|
| Review visible configuration | reg export --json KEY FILE, then reg apply FILE | Does not preserve key descriptors or the complete layered store. |
| Restore a subtree with its descriptors and tagged entries | reg backup KEY FILE, then reg restore KEY FILE | Privileged replacement, not merge. |
| Withdraw a managed bundle | Its role or policy workflow | Layer removal cannot undo permissions or consumer side effects. |
Registry Editor exposes the corresponding Export…, Import…, Back up…, and Restore… actions. Text export cannot be reapplied as a text batch.
Capture a recovery copy #
-
Identify the subtree and the permissions, layers, and consumers that recovery must preserve. Choose protected storage: backup privilege can expose data unavailable through ordinary reads.
-
Capture the subtree, for example:
-
Confirm success and retain the file with its original path and purpose. Interrupted output is not a verified recovery copy.
-
Check whether required layer definitions are also backed up. A stream's layer manifest records metadata for validation but does not recreate definitions. Their keys under
Machine\System\Registry\Layersmust be included or recovered separately.
Backup uses a consistent snapshot while other writes continue. It includes key descriptors, layer-tagged entries, and absence markers. Integrity checks detect corruption; they do not make an untrusted backup safe to restore.
Restore and verify #
-
Confirm the trusted backup matches the intended target. Save current state if recovery from the restore itself is required.
-
Review replacement scope, restored permissions, needed layer definitions, and consumer application timing. The backup root's immutable volatile and link flags must match the target.
-
With replacement approved, restore the earlier example:
-
Reopen paths and inspect representative values, descriptors, and
reg layer ls -l. Then verify consumers and their events. Existing handles retain their granted rights, so use fresh opens to test access.
Restore keeps the target key object, replaces its mutable fields and contents, and replaces descendants. It uses one transaction. Rejection before commit leaves no partial restored subtree; a timeout after dispatch can leave an uncertain outcome. Inspect before retrying. Terminal input prompts for confirmation; redirected input proceeds without that prompt.
Entries whose layer definitions are missing remain inactive until metadata exists. Restored entries also receive fresh ordering; recovery is not a way to restore the global write counter.
Required authority #
Backup and restore use SeBackupPrivilege and SeRestorePrivilege, bypass
ordinary per-key checks, and are audited independently of key audit policy.
Restore can rewrite owners and permissions, including the target key's own
descriptor. Positive-precedence layers in the manifest or existing metadata
also require SeTcbPrivilege; restoring their metadata has its own gate.
Read the kernel's backup and restore reference before building a recovery tool. A global-hive backup does not include an unrelated private hive shadowing the same path for another credential scope.
Recovering a Registry Layer
Peios / Using Peios / The Registry
A layer keeps a bundle's entries identifiable and removable. It is not a snapshot of everything the bundle changed. Prefer the owning role or policy tool when it also manages files, service actions, or other state.
Inspect and recover #
-
Record the effective value, its winning layer, and its sequence with
reg get KEY NAME -L. Inspect the layer inventory withreg layer ls -l. -
Identify the layer's owner and recovery procedure. Save required data and layer metadata before changing it. A narrow subtree backup need not include the definitions that make its layer entries active.
-
If the owner's workflow permits it, disable the named layer first:
-
Reread representative values, check the newly winning layer, and verify each affected consumer at its documented application point. Re-enable with
--enableif the trial does not produce the intended result. -
Delete a layer only after its owner confirms it is unneeded and the replacement state is verified.
reg layer del NAMEis destructive. Its terminal confirmation is absent with redirected input.
Replace KEY, NAME, and the value name with the reviewed targets. The
built-in base layer cannot be disabled or deleted.
Limits of layer recovery #
Disabling a layer removes it from ordinary global resolution. Credentials that explicitly attach the layer can still see it. Inspect the workload's effective thread credentials before concluding that it sees the same state as an administrator's shell.
Removing a layer does not restore key security descriptors, reverse actions already taken by services, or reconstruct earlier values overwritten within that layer. Consumers do not necessarily apply the new winner immediately.
An ordinary write into a new layer is different from retaining previous versions. Equal-precedence layers use write sequence as their tiebreaker, not a fixed order of role names. See Registry Reads, Writes, and Layers for effective reads and authorization.
Operating loregd
Peios / Using Peios / The Registry
loregd supplies the local registry hives that Peios needs during boot. peinit selects the hive names and database paths and supervises the daemon. You normally use the registry through its kernel interfaces rather than starting loregd yourself.
Startup requirements #
The daemon needs these resources before it can serve the registry:
- A SYSTEM token and
SeTcbPrivilegefor native protection and RSI access. - A Peios kernel with RSI lifetime extension version 1.
- Writable persistent database paths supplied as hive declarations.
- A tmpfs-backed
/runwhere it can create and lock/run/loregd.
peinit supplies Machine=/var/state/loregd/Machine.hive and
Users=/var/state/loregd/Users.hive. loregd itself has no path defaults and
reads no configuration file or registry configuration. The
command-line reference describes the
accepted declarations.
The runtime lock excludes a second daemon using /run/loregd. Do not use
that directory or a live hive for a development test. A daemon restart
removes volatile registry data even if the operating system has not rebooted.
Readiness and logs #
If NOTIFY_SOCKET is set, loregd sends READY=1 after registration. The
complete notification attempt has a one-second deadline. Failure is logged
and serving continues, so a missing readiness message does not by itself
prove that registration failed.
Progress goes to standard output and failures to standard error. peinit captures these streams during early boot. The daemon does not require eventd to report an early startup error.
Persistent and volatile data #
Persistent data lives in each named SQLite hive. A hive can have adjacent
WAL and shared-memory files while open. Volatile data lives in fresh,
per-hive databases under /run/loregd and is discarded on every restart.
Do not treat the main SQLite file alone as a live backup: committed data can remain in its WAL. loregd supports read-only RSI snapshots for higher-level backups, but creates no automatic startup backup. See backup and repair limits.
Stopping the daemon #
SIGTERM and SIGINT close the source device. loregd drains requests,
releases transaction state, closes hive connections, and removes volatile
stores. The kernel marks the served hives unavailable when their source
disconnects. This can affect sign-in and other services that use the registry.
Diagnosing Registry Storage Failures
Peios / Using Peios / The Registry
Diagnose a failure from the daemon's captured error output and the failing operation. Process liveness alone does not establish registry health: loregd can remain registered while SQLite returns storage errors.
Startup failures #
The failure stage identifies the relevant checks:
| Stage | Check |
|---|---|
| Argument parsing | Every hive declaration contains a nonempty name and absolute path; folded names are unique. |
| Runtime directory | /run/loregd is tmpfs-backed and available to the SYSTEM daemon; another instance does not hold its lock. |
| Database preparation | Parent paths are writable, SQLite can use WAL, and the database has supported schema version 1. |
| Device access | The Peios registry device exists and the caller has SeTcbPrivilege. |
| Negotiation | The kernel supports RSI lifetime extension version 1. |
| Registration | The hive names and their global registration are accepted by the kernel. |
Argument and startup failures exit with status 1. Readiness notification failure is a warning and does not terminate serving.
Busy and storage responses #
RSI_TXN_BUSY can indicate a competing write transaction, SQLite lock
contention, a blocked checkpoint, or an expired request wait. A read-only
snapshot does not own the write connection, but it can keep WAL pages that
a truncate checkpoint needs to release.
RSI_STORAGE_ERROR includes database failures and invalid transaction state.
An interrupted bound transaction requires abort; using its ID again does not
silently start a replacement transaction. A request timeout does not prove
that an already-admitted commit failed. See
waiting and contention.
Recovery limits #
Startup performs SQLite WAL recovery and removes orphaned persistent keys. It does not restore a backup, rebuild case-folded columns, or repair an arbitrary corrupt database. The schema check is not a full integrity check: it does not validate every existing table definition or detect multiple version rows.
Preserve the affected files and diagnostics before attempting repair. Use
a verified recovery procedure for the actual backup format. The daemon
has no --inspector, --recover-from-backup, or
--dangerously-clear-database switch.
Separate a source outage from a denied operation #
Record the exact operation, key, and error. reg status 3 means access
denied; status 5 includes source and syscall failures. Do not replace a
source database merely because a setting is missing or unreadable.
The registryd role names the selected source provider, not another daemon
beside loregd. Its startup paths come from Peinit's boot policy. Inspect the
installed arguments instead of treating a path from an example as a default.
Do not start a second provider against the live databases to investigate.
On source disconnection, handles remain but operations needing source data fail. Re-registration produces watch overflow recovery: clients must reread the state they need. A timed-out mutation or commit can already have reached storage, so inspect live state before repeating it after recovery.
LCS owns access checks, routing, layers, and watches. That does not make a source untrusted: access checks use descriptors returned by the source, and structural validation cannot detect every well-formed false descriptor or entry. Protect the source process, launch configuration, and backing files as part of the trusted computing base.
Managing Features from the Command Line
Peios / Using Peios / Features
A package supplies a feature's definition and scripts. feat runs its
explicit
setup and records lifecycle state; installing the package alone does not
enable
the feature. Read the feature description before changing it, including when
its effects take place.
Use feat list and feat info NAME to inspect definition availability and
state. Install performs setup; enable activates installed setup; add performs
both. Disable retains setup, while remove disables as needed and then runs
teardown. Removing feature setup does not uninstall its supplying package.
Scripts run with the caller's authority. Permission to write the feature's registry state does not guarantee permission for every script operation. An enabled record also does not prove that a service started or a replacement boot artifact was built and activated.
Recover an interrupted step #
The state records a phase as begun before its script runs, then records the settled state on success. Failure can therefore leave partial external effects and an interrupted phase. It is not an automatic package-style rollback.
Read the script's error and inspect actual state before retrying. Scripts are required to tolerate restarting their phase, but that contract is not proof that an arbitrary third-party script is correct. After addressing the cause, retry the phase or use the supported opposite transition. Verify both recorded state and the resources the script manages; editing the numeric state alone does not finish the work.
Keep teardown available #
Remove setup before removing its package. Otherwise the registry can retain a feature whose definition and scripts are gone. Restore the supplying package, review the restored definition, then run teardown while it is available. Package undo and recovery do not reverse a feature's registry or runtime work.
Machine clients should use the documented JSON query or driven event stream,
not parse human output. Driven changes provide scripts with empty standard
input and do not become cancellation-safe merely because the client goes away.
Inspect the eventual state after a disconnected request. feat(1) owns state
values, command options, stream outcomes, and exit statuses.
Managing Features in Feature Manager
Peios / Using Peios / Features
Feature Manager controls feature definitions supplied by installed packages. A feature performs configuration beyond copying package files, such as setting up services. Installing its package and enabling its feature are different operations.
Before you start #
You need Feature Manager and permission to run the requested operation
through feat. Read what the feature changes before applying it.
Choose the feature state #
- Open Feature Manager and inspect the feature's description and state.
- Choose Turn On to install and enable its setup, Install Only to set it up without enabling it, or Turn Off to disable it while retaining its installed setup.
- To remove the feature's setup, choose Remove and review the confirmation. Its package remains installed.
- Follow the card's progress and read the outcome or failed script output.
Check the result #
Confirm the final feature state and verify the affected service or setting. Interrupted identifies a script that did not finish; Try Again reruns it. Review the failure before retrying. Definition Missing means installed feature state survives after its definition package was removed.
An approved operation continues until completion when the window is asked
to close. The window stays open with an explanation and closes afterward.
Feature Manager delegates authority and state changes to feat; it does
not grant privileges. See gxwi-feature-manager(1).
Missing definitions and limited access #
If a definition is missing, restore its package before asking feat to run
the feature's cleanup. Removing a package does not undo the configuration its
feature created. Keep the package available until the feature is removed.
The read-only view can show feature states without offering change buttons. Permission to change state does not supply every privilege a feature script needs. Read the failed script's output and investigate its access requirements before retrying; the app does not elevate it automatically.
Keeping the Time
Peios / Using Peios / Time
timed keeps the machine clock aligned with network time sources. Certificate validation, authentication, and the ordering of records depend on that clock. A time zone changes how programs display time; it does not correct the clock.
The service compares measurements from several sources, rejects conflicting measurements, and adjusts the clock's rate. Its reported accuracy estimates uncertainty from those measurements. It is not independent proof of the time.
Sources are not trusted individually #
Each server supplies an interval in which it estimates the true time lies. timed selects an overlapping set and rejects sources outside that agreement. A rejected source is called a falseticker.
Three sources with independent failure modes can let an agreeing majority exclude one incorrect source. One source has no independent comparison. Two disagreeing sources do not establish which one is correct. Several names can still share an operator, upstream clock, or network failure.
Authentication proves the identity of a source. It does not prove that the source reports the correct time.
Every source is authenticated #
By default, timed requires Network Time Security (NTS). A Transport Layer Security (TLS) exchange on port 4460 establishes keys for authenticated Network Time Protocol (NTP) messages.
timed checks the certificate against the configured server name, using roots supplied by trustd for server authentication. A DNS alias can change the address used for the connection; it cannot choose a different trusted certificate identity.
Roots are loaded at startup and refreshed after handshake failures. timed does not subscribe to trust-store changes. A distrust change therefore does not immediately invalidate an established NTS session or its cached cookies.
A blocked key-exchange port prevents new handshakes. Cached cookies can keep an existing source usable without another handshake. If no usable source remains, timed reports that the clock is unsynchronized. Allowing plain NTP is an explicit policy choice described in Configuring Time Sources.
The default sources #
When neither configured sources nor eligible network-provided sources supply a list, timed uses these operator hostnames:
time.cloudflare.comnts.netnod.septbtime1.ptb.de
These names identify three operators. They do not guarantee independent upstream clocks, reachability, or correct time. Replacing a fallback operator requires a configuration or software update; changing a Peios DNS alias does not change the authenticated identity.
Two circles, and how they are broken #
A machine with an incorrect hardware clock can reject valid certificates as not yet valid. timed raises a clock below its recorded build epoch to that lower bound. The epoch is stored in the source tree so that rebuilding the same source does not change the bound.
The floor is a bootstrap aid, not verified time. Certificates still have to be valid at the resulting clock reading. A machine can remain unable to complete a handshake after the floor is applied.
NTS cookies from successful exchanges are saved under /var/state/timed.
They can let a restarted service obtain authenticated time before another
TLS exchange. The startup hook protects this state for SYSTEM,
Administrators, and timed's service identity. Cookie files contain secrets.
Steering, not jumping #
Ordinary correction changes the clock's rate gradually, called slewing. A clock step changes the wall-clock reading immediately and can affect file timestamps, log ordering, and software that uses wall-clock deadlines.
The automatic discipline permits an initial correction of any size when usable sources agree. After synchronization, a persistent large offset can cause a step after 15 minutes. An offset above 1000 seconds is refused rather than automatically accepted after synchronization.
Manual changes and the boot floor also step the clock. Turning automatic time back on restarts source acquisition and permits another initial correction. A reload is not a guarantee of uninterrupted wall-clock time.
Each step emits timed.clock.stepped. Its operation.name distinguishes
automatic, manual, and boot-floor. See the
installed evman timed.clock.stepped definition and the
timed.clock.stepped evman entry for the recorded fields. Slewing does not
emit a step event.
Learning the crystal #
timed estimates the machine clock's frequency error and saves it in
/var/state/timed/drift. Reusing that estimate can shorten settling after a
restart. Accuracy without network measurements depends on the clock's
stability and the quality of the saved estimate.
What timed does not do #
timed is a client, not a network time server. It does not serve time to other machines or directly write the hardware clock. The kernel periodically updates the hardware clock when the system clock is marked synchronized.
The machine clock represents UTC. timed applies the selected local-zone data
to /etc/localtime; individual programs can choose a different display zone.
See Changing the Time Zone and
Clock
for the distinction and the operational checks.
Configuring Time Sources
Peios / Using Peios / Time
Configure time sources when the machine needs a particular operator or a network's time service. Check the effective sources after applying policy: a saved setting does not establish synchronization.
Before you start #
- Install and start timed and its
clockcommand. - Obtain write access to
Machine\System\Timeto change policy. - Obtain timed's control right to request a reload. Registry write access and the control right are separate permissions.
- Choose sources with independent failure modes. Prefer authenticated sources and check that their certificates cover the configured names.
The regman entry for Machine\System\Time owns the complete configuration
reference. clock(1) describes the command interface.
Naming your own servers #
-
Inspect the existing state and policy:
-
Set the source list. This example selects the shipped public operators explicitly, so network-provided time servers cannot replace the list:
-
Reload and check the result using the procedure below.
An entry names a host, optionally a port, followed by supported option words.
prefer breaks ties between agreeing sources. It does not make a disagreeing
source valid. A malformed entry is logged and omitted.
Precedence is first match, not merge #
timed selects the first nonempty list in this order:
- Successfully parsed
Serversentries. - Network-provided time servers, when
UseFromDHCPpermits them. - The shipped fallback set.
The selected list replaces later choices. A domain policy can write
Servers; the selector has no separate domain-discovery stage.
Authentication filtering happens after selection. An explicit list containing
only plain-NTP sources produces no usable sources when
AllowUnauthenticated is 0; it does not fall through to public servers.
If every explicit entry is malformed, selection continues to the next list.
To remove an explicit override:
This restores the selection order. It does not necessarily select the public fallbacks because network-provided sources can take precedence.
Turning authentication off #
Plain Network Time Protocol (NTP) does not authenticate replies. Someone who can observe and alter the exchange can supply false time. Certificate validation and authentication systems can be affected by an incorrect clock.
For an explicitly configured plain-NTP source, both settings are required:
- The entry includes
unauthenticatedornoauth. AllowUnauthenticatedis1.
Use this policy only after accepting the trust placed in the server and its
network path. Changing AllowUnauthenticated back to 0 excludes all plain
sources, including those explicitly marked unauthenticated.
DHCP time servers #
Dynamic Host Configuration Protocol (DHCP) time servers are eligible when
UseFromDHCP is 1 and no valid explicit list takes precedence. They are
plain-NTP sources, so AllowUnauthenticated must also be 1.
Before allowing them, account for every network the machine can join. A network controls the time-server addresses it offers. This machine-wide setting follows the machine between networks.
netd publishes DHCP option 42 independently of whether its offered DNS configuration is accepted. See The Resolver Channel. timed applies its own time-source policy to that information.
Poll intervals #
MinPoll and MaxPoll are powers of two seconds. Their defaults are 6 and
10, giving intervals from 64 seconds through about 17 minutes. Values are
clamped to the range documented in regman.
Shorter intervals increase server traffic. Longer intervals help estimate frequency error. Keep the defaults unless measurements justify a change.
Doing it from a domain #
Distribute time policy through registry policy using the same values. The policy must still produce sources that pass authentication and selection. A successful registry update does not establish correct time on each machine.
Reload and verify #
-
Request a reload:
-
Inspect the source list and clock state:
-
Check the source names, authentication, failure notes, selected source, accuracy estimate, and age of the last update. Repeat after further polls if the clock is still settling.
A failed configuration read retains the last complete configuration and returns a reload error. A registry notification triggers another read. Malformed individual server entries remain warnings and are omitted. A successful reload means the configuration was read, not that sources have answered or agreed.
When something is wrong #
A source marked falseticker disagrees with the selected set. Investigate
that source and the agreement among the others; the label alone does not
prove which clock is correct. An unreachable source includes a failure note
when timed has one.
If no source is selected, compare Servers, UseFromDHCP, and
AllowUnauthenticated with the reported list. Check whether Automatic is
0. A wrong local-zone display needs a zone correction, not necessarily a
change of time source.
If reload is refused, check the separate
control permission.
A refused reload does not undo a registry write. If clock cannot contact
timed, it has not established whether sources are usable.
Changing an active source list #
Reordering sources preserves each unchanged source's session and pending work. Removing a source discards results that arrive for that old source. Changing its port or authentication mode starts a new association. A source removed and later added again does not inherit an earlier pending result.
Changing the Time Zone and Clock
Peios / Using Peios / Time
Change the time zone when the clock is correct but local time is displayed incorrectly. Set the clock manually when no suitable time source is available. The machine clock represents UTC; the zone controls its local display.
Before you start #
- Install timed,
clock, and the time-zone database. - Obtain registry write access to
Machine\System\Timeto change settings. - Obtain timed's control right to reload or set the clock.
- Before a manual change, account for its effect on timestamps and software that uses wall-clock deadlines.
clock(1) owns the command syntax. The regman entry for
Machine\System\Time describes the settings and access checks.
Using the graphical settings {#in-system-settings} #
Open System Settings and select Time & Date to inspect the machine's zone, automatic-time policy, and sources. Changing machine time is separate from choosing a 12- or 24-hour desktop display; see Desktop Settings.
Verify the effective zone and clock state after a change. A saved setting does not prove that the zone data was applied or that sources agree.
In a terminal #
Change the time zone #
-
Check the reported zone:
-
Select an installed zone, for example:
-
Read
clock statusagain and check timed's log for zone errors.
The name identifies data under /usr/share/zoneinfo. An invalid or missing
zone is refused before copying, leaving the previous file in place. timed
retries a refused name after configuration changes and every 10 minutes.
Deleting TimeZone requests UTC.
On restart, timed identifies the zone only when its saved name and installed
zone data match /etc/localtime. If identification fails, clock reports
UTC (none chosen), even if the existing file contains another zone.
A copy failure after /etc/localtime is truncated can leave incomplete data.
The retained status name is not a fresh verification of the file. Resolve
copy or saved-name errors before interpreting or setting local time.
Set the clock manually #
-
Confirm the zone and resolve any errors described above.
-
Turn off automatic time and reload:
-
Run
clock setwith the intended local date and time. For example, the syntax for 14:05 on October 19, 2026 is: -
Check
clock status. It should report manual operation and the intended zone. Manual time is not network synchronization.
Use @SECONDS instead of a local date to specify a UTC Unix timestamp.
timed refuses manual setting while Automatic is 1.
Return to automatic time #
-
Account for a possible clock step when sources agree. Reacquisition permits an initial correction of any size.
-
Restore automatic operation:
-
Check
clock sourcesandclock statusas measurements arrive. Confirm authentication, agreement, accuracy, and fresh updates.
Coordinating changes with timed {#why-not-just-set-the-clock} #
Changing the clock outside timed leaves the service measuring an unexpected
error. It can correct the change or refuse a sufficiently large offset.
Using clock set coordinates the change with the service and emits
timed.clock.stepped with operation manual and the requesting identity.
Read the installed definition with evman timed.clock.stepped.
Individual programs can display UTC with date -u or use a TZ environment
setting where supported. Those choices do not change the machine clock.
File validation #
Zone files and metadata must be regular files of at most 16 MiB. Aliases to regular files are supported. Timed checks the opened zone file and copies that same data, so validation and copying cannot select different files.
Timed updates the pre-created /etc/localtime file in place. Readers can
observe an empty or partial copy, and a write failure can leave a partial
copy. Its directory permissions do not allow an atomic rename by the service.
Understanding Clock Status
Peios / Using Peios / Time
clock reports what timed knows about the machine's time. Its status and
source views help distinguish a display-zone problem from a failure to obtain
usable time. clock(1) owns the command syntax and exit-status reference.
Status #
Read clock status starting with state, following, accuracy, and
the age of the last update. The state labels retain their wire spelling:
| State | Meaning |
|---|---|
synchronised | The clock is being kept from usable measurements. |
settling | The frequency estimate is still converging. |
spike | A large offset is being checked before changing the clock. |
unsynchronised | The clock has no accepted synchronization. |
Manual operation adds Automatic is 0: the clock is set by hand. That is
not evidence of network synchronization.
Accuracy combines uncertainty reported by the selected measurements. It helps assess clock quality, but does not independently prove the time. Frequency estimates the hardware clock's error in parts per million. The saved drift estimate lets later starts reuse what timed has learned.
Stepped records cumulative steps since startup. Unexpected changes call
for inspection of timed.clock.stepped events. Manual changes, automatic
corrections, and the boot floor have distinct operation names.
Floor is the recorded build epoch, used as a lower bound. Remaining near the floor does not establish correct time or certificate validity.
Time zone is timed's recorded zone for /etc/localtime. An unidentified
file is displayed as UTC (none chosen). A failed copy can also leave the
reported name without valid corresponding data. Resolve errors using the
zone procedure.
Sources #
clock sources shows each source's state, authentication, reach history,
measurements, and age. The leading markers summarize selection:
| Mark | State | Meaning |
|---|---|---|
* | system-peer | Selected source for the system's reference figures. |
+ | candidate | Agrees and contributes to the combined measurement. |
- | outlier | Agrees but is excluded because of measurement quality. |
x | falseticker | Disagrees with the selected set. |
? | unusable | Has answered but cannot supply usable time. |
| blank | unreachable | Has no usable reply history. |
Auth distinguishes authenticated NTS from plain time. Reach is an
octal mask of the last eight polls, newest in the lowest bit. 377 means
all eight answered; 376 means the latest poll failed; 0 means none
answered. Stale measurements stop contributing when reach is lost.
Last is the age of the last answer. Read any note below a source before changing policy: a connection failure and a certificate failure need different investigation.
Setting the clock #
clock set requests a coordinated manual step. It requires manual mode and
timed's control right. The
manual-time
procedure
covers prerequisites, local-zone interpretation, and checks afterward.
Exit statuses #
An unsuccessful query does not establish the state of the clock. In
particular, a failed connection differs from a successful source query
finding no sources. Scripts should use the exit statuses documented in
clock(1) instead of inferring success from partial output.
When reload is refused #
Reloading and setting time require timed's control right. Querying status
and sources is public under the default policy. The control descriptor is
Machine\System\Time ControlSecurity; SYSTEM and Administrators receive
control access by default.
Registry write access is a separate check. A successful policy write does not prove that the caller can reload, and a refused reload does not undo the write. A configuration-read failure also makes reload fail while timed retains its last complete configuration.
Configuring Profiles
Peios / Using Peios / Network Configuration
Network configuration is two kinds of key under Machine\System\Network. A
profile, a subkey of Profiles, says how an interface stands on a
network: what to take from the network's offer and what to dictate. A
rule, a subkey of Rules\Interface, says which interfaces stand in which
profile. netd watches the subtree, so a change takes effect within a moment of
the write — no restart, no reload command.
Follow this order: inspect the active interface, prepare the profile, select it with a rule, then read back the accepted state. For desktop changes, use Network Manager, whose profile editor shows inherited values and the interfaces a change affects.
Read the registry value reference on the machine with
regman 'Machine\System\Network'.
Before you change anything #
- You need write access to the particular registry keys. Reading status
does not grant permission to change configuration; protected
Statuskeys are netd's output, not settings to edit. - Record the current rule, profile, and values so you can restore them. Keep local console access or another recovery path if this network carries your remote session.
- Profile and rule writes take effect live. Changing a profile's resolved values restarts its interfaces' clients, even for a DNS-only profile edit. No reboot or daemon reload is required.
- Use a derived profile for one interface. Editing
defaultaffects every interface using it and descendants that inherit the edited value. - The commands below are examples. Replace addresses, names, ids, and bus
paths with your own. The
vpn,office,laptop,untrusted, andhomeprofile examples assume those profiles already exist.
See what you have #
Keep this output for comparison after the change. net status shows each
interface with its verdict: the rule that spoke and the profile it stands in.
An image's baseline is a profile default that takes the network's address,
way out and name servers, and a rule wired that puts every wired interface
in it at priority 10.
A static address #
Create the profile before a rule names it. This example derives default/db1
from default, so values not listed here remain inherited, including
Dns.Offered and Address.LinkLocal. Lists replace inherited lists; they do
not append. An absent value inherits, while a present empty value means none.
Confirm that 10.0.0.5/24 is appropriate and available on your network and
that 10.0.0.1 is its gateway before adapting these example writes:
Then a rule naming the interface by its bus path (from net status, stable
across boots), as an exception under the baseline's wired rule so it is
judged only for wired interfaces:
The exception is more specific than wired, so it selects default/db1 for
that interface and stops offered address acquisition. Check for
JOIN(default/db1) by wired/db1 and the intended address and gateway in
net status; readiness routed appears once both a usable address and the
default route are in place.
Inherited Dns.Offered is a setting, not evidence that a server is available
after address acquisition stops. Check resolv status. To pin DNS as well,
set Dns.Offered = 0 and Dns.Servers on this derived profile. The inherited
link-local setting does not add a fallback beside a static address. See
desired state.
Verify the accepted settings #
- Confirm the rule names the intended profile and matches the intended
interface.
net profileslists each profile's own values, not a flattened result; account for inherited values. - Check that
net statushas nopolicy REFUSEDline. Read the active verdict, rule and profile, then the address, gateway, lease and warnings. - Check the servers and domains in
resolv status, and test a relevant name withresolv query <name>. - Test the service you actually need. Readiness
routedproves a default route exists, not that a remote service or the Internet answers.
If you also changed firewall rules or a network's Name or Trust, an
administrator should run net policy wait and check net policy. That
verifies the kernel's packet policy; it does not substitute for checking
netd's accepted profile in net status.
If the result is wrong, restore the values you recorded and repeat the checks.
net reconcile requests another pass; it does not undo a write.
net renew <interface> asks to renew an existing DHCP lease without releasing
it first. Both need NETWORK_CONTROL, granted to SYSTEM, and Administrators
by default.
Facts a rule can name #
Every <Fact>.<Operator> value present must hold. Comparison is exact;
Equal takes a list for any of.
| Fact | Matches | Example |
|---|---|---|
Interface | the kernel's interface name | enp0s3 |
Interface.Kind | wired, wireless, loopback, other | wired |
Interface.Id | the stable id from net status | 3f2a1b8e-… |
Interface.Mac | the hardware address | 52:54:00:12:34:56 |
Interface.Path | the bus path | pci-0000:00:03.0 |
Interface.Driver | the kernel driver | virtio_net |
Network.Name | the Name you gave the network's record | palfrey-home |
Network.Trust | the Trust you gave it | corporate |
Prefer Interface.Path or Interface.Id for a specific card and
Interface.Kind or Interface.Driver for a class. Interface (the name) is
the least stable: the kernel might call the same card something else after a
hardware change. A fact the interface lacks — a tunnel has no Path — makes
the condition false, never an error.
Taking the offer, with adjustments #
default believes the network about the address, the way out and the name
servers. To keep the address but pin DNS, override two values in a derived
profile and point a rule at it — or, if the whole machine should behave so,
edit default itself:
Three more Dns values decide which names an interface's servers are asked
for, which matters the moment a second interface appears — typically a VPN:
Dns.Domains sends names under corp.example to this interface's servers.
Dns.Default sends every other name there too (unset, an interface claims
that only when it carries the default route). Dns.Exclusive takes all
queries only while the interface is at least addressed and supplies a DNS
server. Without those conditions it does not prevent another interface from
being chosen. Verify the VPN's addresses and server lines before relying on it
to keep names off another network. resolvd owns resolver selection;
resolvd(8) describes that service.
To hold an offered address across a server outage:
Keep trades the risk of an address conflict for continuity; the default
Drop is the safe choice.
IPv6 #
Address.Offered covers both families: on a network with router
advertisements the interface gets a stable-privacy address per advertised
prefix, and with Route.Offered and Dns.Offered the advertised default
route and DNS from RDNSS or stateless DHCPv6. Three values change that:
Address.Families = ipv4 stops router discovery on interfaces in the profile
and drops IPv6 entries from Address.Static. Address.Temporary adds
daily-rotating temporary addresses beside the stable one, for machines whose
traffic should not correlate over days; the stable address remains for
inbound. An IPv6 entry in Route.Gateway — usually a link-local address —
pins the default router instead of believing advertisements.
The stable address survives reboots and reinstalls that keep /var/state/netd
; it is not derived directly from the MAC, and a different network sees an
unrelated address. The IPv6 address
chapter documents derivation,
lifetimes and rotation.
Prefer a cable over WiFi #
When both interfaces have default routes, the metric decides which is used.
Wired defaults to 100 and wireless to 600, so no configuration is needed. To
invert it, set Route.Metric on the profiles. This describes route preference
once links exist; Wi-Fi association is not implemented by netd, wireless is
not in the baseline, and Network Manager shows wireless as Not managed.
Name a network, and behave differently on it #
Once an interface has stood on a network, net status shows the record's id.
Give it a name and your word on it:
Changing either label can change both the selected profile and firewall access. Check the active interface and packet policy afterward.
The following illustrates choosing a profile by network. It is not a Wi-Fi
setup procedure: a supplicant must supply the link, and wireless network-name
identification is unfinished. Create the untrusted and home profiles
before a rule names them:
Until a network has been identified on the link, the Network.* facts are
absent, so the radio stands in untrusted first and moves to home once the
network is known. Trust is your label, not verified evidence of network
identity: a rule that conditions on it is stating that you accept the
identification. The same word reaches the firewall: a Flow rule with
Network.Trust.Equal = home sees the network the radio is on, so what you
open at home stays shut at the cafe. See the network context in the
Peios Network Policy specification for the shared firewall contract.
Hand an interface to something else #
An IGNORE verdict leaves a matched interface alone: no new addresses,
routes, link changes, or DHCP. If it was previously joined, existing addresses
and routes remain; IGNORE is not a cleanup action:
Take an interface down #
A DOWN verdict keeps a matched interface administratively down. DOWN wins
equal-priority ties, but a higher-priority rule still wins. Check existing
priorities before using the example priority 100:
The interface id is in net status. Delete the rule, or set Enabled = 0 on
it, to let the remaining rules decide again. Verify that they select the
intended profile; removing DOWN alone does not guarantee a JOIN.
Ask for the same address #
The address a network last leased is on its record, and netd asks for it first. Write it yourself for a soft reservation — a request the server might refuse, unlike a static address:
Set the hostname #
netd applies it on the next pass. A profile with Hostname.Offered on adopts
a network-supplied name when this value is unset; Hostname.Announce tells
DHCP servers the name so their DNS can register it. Both are off in a bare
profile.
Each change netd makes to the machine's name is recorded in the event log as
netd.hostname.changed, with the name before and after
(config.text-previous and config.text). The netd manual's hostname
chapter says exactly when.
netd validates the name as one network label:
letters, digits, and hyphens, at most 63 of them, not beginning or ending with
a hyphen, and not localhost. System Settings holds it to that as it is
typed: in its About section, Machine Name says what is wrong with a
name before it can be applied, and shows the name the machine has now if netd
hasn't applied the new one yet; Apply appears once the name has been
changed. The About section also shows what the machine is and runs: the system
and its edition, the kernel, how long it has been up, the hardware, and the
disks.
When netd refuses #
An unknown fact, a JOIN naming a missing profile, or an unknown profile
value refuses the whole new interface generation. netd keeps the last good one
and net status reports policy REFUSED with the reason. Fix the named
entry, then verify the next write was accepted; the registry listing alone
does not tell you what is active.
Two equal-priority rules selecting different profiles also refuse a runtime reload when the conflict affects an existing interface. At startup, or for an interface that appears later, the tied interface is instead ignored and its warning names both rules. Make one rule unambiguously win. The generation and interface judgment chapters describe that distinction.
A JOIN naming an existing but disabled profile abstains; its parent, another
rule, or the backstop answers. Disabling a profile does not exempt malformed
values in it from validation.
Where to go next #
- The net command — read back what netd did.
- Networking — the model behind these keys.
regman 'Machine\System\Network'— registry values and their meanings.- The interface layer as netd runs it, in the netd technical reference manual — how netd reads these keys, builds a generation from them and judges each interface.
The Net Command
Peios / Using Peios / Network Configuration
Use net status first. It shows what netd accepted and what is present on
each interface. Use net rules and net profiles to compare that state with
the registry configuration. On the desktop, the same starting point is
Network Manager's
Overview.
net does not write profile or rule configuration. Follow Configuring
profiles to change it, then return
here to verify the result.
After a change #
- Profile or interface rule: check
net statusfor the intended verdict, rule and profile, nopolicy REFUSEDline, and the expected addresses and gateway.net profilesshows each profile's own values, so inherited settings still matter. - DNS: check
resolv statusand a relevantresolv query <name>. - Firewall rule or network label: as an administrator, run
net policy wait, thennet policy. A returned registry write is not yet proof that the kernel accepted it. - Connectivity: test the required service.
routedmeans there is a usable address and a default route, not a successful Internet probe.
The interface and packet policy are accepted independently. A successful
net policy wait does not prove that netd accepted a profile; a good
net status does not prove that the firewall accepted a rule.
Reading net status #
hostname workshop
readiness routed
enp0s3 [3f2a1b8e-…]
verdict JOIN(default) by wired
state up, carrier
readiness routed
hardware 52:54:00:12:34:56 pci-0000:00:03.0 virtio_net
network palfrey-home [9c0d4e21-…] trust home
address 10.0.2.15/24
gateway 10.0.2.2
dns 10.0.2.3
lease bound from 10.0.2.2, 86395s left
verdict is what the interface layer said and who said it: the verdict, the
profile (for JOIN), and the rule path that spoke — backstop when no rule
did. readiness is absent (down or no carrier), link, addressed or
routed, shown for joined interfaces; the machine's is the highest among
them. network is the record under Machine\System\Network\Networks
identified on the link, with the Name and Trust you gave it.
The bracketed value after the name is the interface id — the inventory key
under Machine\System\Network\Interfaces.
Read the interface block, not only the machine's readiness: another interface
can make the machine routed while this one is unusable. An IPv4 link-local
address counts as addressed; IPv6 link-local alone does not. Only joined
interfaces contribute to machine readiness.
A warning line can mean DHCP discovery went unanswered or two rules tied and
this interface is ignored. policy REFUSED: means the newest interface
generation was rejected and the last good one stands. Correct the named rule
or profile and read status again. A listed registry write is not proof it took
effect.
Commands #
| Command | Does |
|---|---|
net status | Hostname, the machine's readiness, whether the newest generation was refused, and every interface: verdict with the rule and profile behind it, link state, readiness, hardware identity, the network identified on it, addresses, gateway, DNS, lease, warnings. |
net wait <level> [seconds] | Block until the machine reaches link, addressed or routed, or the timeout (default 60) passes. For scripts that need the network. |
net renew <interface> | Renew the DHCP lease now. Accepts a kernel name or an interface id. |
net reconcile | Re-run the reconciler immediately rather than waiting for an event. |
net policy | The kernel's side of the packet policy: whether the filtering engine (NTFE) is enforcing, its generation, whether every change written so far is in force, whether the last re-read was refused, and how many interfaces have a network context. |
net policy wait [seconds] | Block until every change made to Machine\System\Network before the command started is in force in the kernel, or the timeout (default 10) passes. Fails if the kernel refused the new generation. For scripts that write a rule and then rely on it. |
net rules | The interface layer, one rule per line: path, priority, conditions, actions. |
net profiles | The profile tree, one profile per line with the values it sets itself. |
Choose renew or reconcile carefully #
net renew <interface> asks a DHCPv4 client holding a lease to renew it
without releasing its current address first. A client with no lease is left as
it is; a successful request alone does not prove a new lease arrived. Check
the lease afterward. The argument might be a kernel name or the stable
interface id shown by net status.
net reconcile asks netd to apply the configured desired state now. It does
not reload a different configuration, undo a write, or make an invalid gateway
reachable. Neither operation requires a reboot.
Use these commands when a restart is unnecessary. On restart, netd asks to reuse its remembered IPv4 address and keeps that address and applicable routes while revalidation is pending. A rejection or timeout discards that provisional state. It must reacquire offered DNS and IPv6 information. See startup.
Each control request has a 5-second total deadline, including connection, request transmission, and response reading. A timeout does not prove that a renew or reconcile request had no effect. Check status before retrying.
Required access #
status, wait, renew, and reconcile reach netd through
/run/netd/control.sock. The control object is a security descriptor:
Machine\System\Network\ControlSecurity, or a compiled default when that is
unset. status and wait need NETWORK_QUERY, which the default grants to
everyone. renew and reconcile need NETWORK_CONTROL, which the default
grants to SYSTEM and Administrators. rules and profiles read the registry
directly and need only read access to it. policy and policy wait ask the
kernel through /dev/peios-ntfe, which ordinary users might lack access to. A
denied request reports access denied.
Exit status #
| Code | Meaning |
|---|---|
| 0 | Done; for wait, the level was reached; for policy wait, the changes are in force. |
| 1 | netd refused or could not be reached; for wait, the timeout passed; for policy wait, the timeout passed or the kernel refused the generation. |
| 2 | Usage error. |
See also #
- Networking
- Configuring profiles
regman 'Machine\System\Network'on the machine, for every key netd reads and writes.- netd's control
socket, in the netd
technical reference manual: the requests behind every
netcommand, and their replies.
Network Manager
Peios / Using Peios / Network Configuration
Network Manager combines interface configuration, name resolution, and firewall policy in one desktop application. It reads netd, resolvd, kernel state, and registry settings as your account. Each operation remains subject to the backend's access checks.
Finding the right view #
The application groups its views by purpose:
| Group | Views and purpose |
|---|---|
| Network | Overview, known networks, profiles, profile rules, and DNS |
| Firewall | Exposure, rule editing, connection tests, and activity |
| System | Port reservations, audit level, and advanced daemon settings |
Overview maps an interface to its selected profile and network, with addresses, routes, traffic, and lease information. A Connected summary means there is a route; it does not prove that a particular service or the Internet is reachable. Wireless interfaces are shown as unmanaged by this implementation.
Networks records identities and trust levels. Profiles define configuration and Profile rules choose where it applies. DNS queries resolvd and manages fallback servers, search domains, static names, and its cache. Port-reservation permission to bind a socket is separate from firewall permission for traffic to reach it.
Example firewall data #
The listener, connection, counter, and recent-audit displays under the firewall interface use constructed examples. Affected panels say Example data, and the status line says Example. They use real rules and some real machine context, but are not a live inventory of traffic or listening services.
The saved rules and network settings are real. A connection test predicts a policy result; verify a policy change with the actual connection or service you intended to affect. Do not use an example activity panel as evidence that a connection happened or was blocked.
Permissions and refresh #
Settings are checked for write access by registry key. Runtime Renew lease and Reapply use netd's control right. Read-only panels explain why a change is unavailable. Exposure and Activity also restrict access.
Live machine data refreshes every two seconds; registry changes trigger settings refreshes. A daemon refusal is shown with the previous accepted configuration or generation still in force. See Changing Network Settings before making a change through a remote desktop.
Changing Network Settings in Network Manager
Peios / Using Peios / Network Configuration
Use Network Manager to change the intended profile, selection rule, or firewall rule, then verify its live effect. Some changes can disconnect the desktop through which you are working.
Before you start #
You need permission to change the relevant settings. Record their previous values and keep another recovery path for changes that can affect remote access. Not every change has automatic undo.
Apply a controlled change #
- Open Network Manager and inspect the affected interface in Overview. Record the profile, rule, network, and addresses it uses.
- Open the relevant profile, profile rule, or firewall rule. Inspect the preview and any affected interfaces or desktop connections.
- Save the intended change. If the application warns that it would disconnect an active desktop, read the affected connections before deciding whether to continue.
- When Keep this change? appears, test the intended connection before selecting Keep. Select Undo to revert, or allow the 30-second server-side timer to expire.
Check the result #
Return to Overview and check the actual interface state. For a name change, perform the intended lookup; for a firewall change, test the actual connection. Read the accepted policy generation and any refusal. Example firewall activity is not live confirmation.
Which changes have undo #
The keep timer covers firewall and profile-rule changes, exposure changes, and relevant changes to profiles or known networks carrying desktop connections. A change accepted after a disconnect warning also receives the timer. Starting another guarded change keeps the preceding one.
DNS settings, static names, port reservations, audit levels, and new profiles can apply immediately without that bar. Restore their recorded previous values explicitly if needed. The server runs the guarded timer, so losing the browser connection does not prevent its expiry.
See gxwi-network-manager(1), net(1), and resolv(1) for command
interfaces and backend behavior.
Checking Connectivity
Peios / Using Peios / Network Configuration
Network readiness, name resolution, certificate trust, and permission to connect are separate checks. Preserve the failed command and its diagnostic before changing configuration.
Follow the symptom #
- Run
net statusto identify the affected interface, its carrier, rule, profile, addresses, and route. Runresolv statusfor the DNS servers actually selected. - Choose the next check from the table. Use the intended service and host, rather than treating any successful probe as proof of full connectivity.
- If a change is necessary, follow the owning component's procedure with a local recovery path. Then repeat the original failed operation.
| Observation | Next check |
|---|---|
No carrier or readiness absent | Link, cable, and the interface verdict. |
IGNORE, DOWN, or no profile | net rules and the profile-selection policy. |
| Carrier but no offered address | Profile families and Address.Offered, server reachability, and DHCP policy. |
Only a 169.254 address | Link-local fallback; it does not establish a routed lease. |
| Address but no default route | Route.Offered or the configured gateway and route-addition diagnostics. |
| IP works but a name fails | resolv query NAME, server selection, and not-found versus unavailable. |
| One service fails | Its listener, bind authority, packet policy, and application response. |
| Stored changes do not apply | netd's acceptance and the kernel's packet-policy acceptance separately. |
| TLS verification fails | Expected peer identity, selected trust anchors, and the reported certificate. |
The profile workflow and resolver guide explain their own checks. For firewall changes, use Changing Network Policy.
Readiness and ownership #
Readiness progresses through absent, link, addressed, and routed.
An address can be link-local; a default route does not prove Internet, DNS,
or application availability. net wait accepts at least its requested
level, while Peinit's declared readiness dependency matches a published
level. Check the readiness
reference when
choosing a service dependency.
netd owns addresses on joined interfaces and its tagged routes. Manual
address changes can disappear during reconciliation. It leaves the kernel's
IPv6 link-local address and other programs' route tags alone. IGNORE is
not a cleanup request. Restarting netd can interrupt offered configuration
while DHCP and router discovery run again; it is not a harmless reload.
Network Name and Trust labels are operator policy, not authenticated
proof of the network's identity. Changing them can affect both interface
selection and the firewall. Wireless association requires a supplicant;
netd's profiles do not implement association, and the baseline leaves
wireless unmanaged.
Compare daemon and network evidence #
Inspect captured service output when configuration does not explain a failure:
Use ss -lnt on the receiving machine to inspect TCP listeners. A targeted
nc -vz HOST PORT checks a TCP connection, not application correctness.
dig @127.0.0.53 NAME A queries the local DNS stub directly; it does not
change resolver policy. Choose hosts and traffic you are authorized to test.
An absent echo reply does not establish that a host is down. Ordinary echo uses datagram sockets, while packet capture and some probe modes require raw-socket authority. Neither installing a diagnostic utility nor selecting its privileged mode grants native privileges or a firewall exception.
The network utility compatibility reference describes the Peios ports' file, authority, and supported-mode differences. Tool availability depends on the installed packages, not this guide.
Diagnosing Name Resolution
Peios / Using Peios / Network Configuration
Use resolv to identify whether a name is missing, resolution is unavailable,
or an unexpected interface is being used. Interface DNS policy belongs to
netd. resolvd applies that policy and machine-wide fallback and static-name
settings.
Before you start #
- Install resolvd and the
resolvoperator command. - Identify the failing name and the network it should use.
- Obtain registry write access before changing policy. Queries use the resolver's separate query permission, granted publicly by default.
resolv(1) owns command syntax and exit statuses. The regman entry for
Machine\System\Network\Dns owns machine-wide settings. Do not edit
/etc/hosts, /etc/resolv.conf, or nsswitch.conf to change this policy.
Check a name first #
-
Read the effective state:
-
Query the failing name. For example:
-
Compare an answer obtained without consulting the cache:
The final command bypasses cache lookup but can store the resulting answer. Read the reported outcome, source, server, and interface. If connecting to an address also fails, investigate connectivity.
Where the servers come from #
netd sends resolvd each interface's servers, domains, and addresses as a
scope. Compare the scopes in resolv status with net status and the
intended interface profile.
Use Configuring Profiles to change offered or explicit interface DNS settings. A profile change can restart address clients; follow that guide's recovery checks.
Machine-wide fallback servers, extra search domains, and static names live
under Machine\System\Network\Dns. They apply after a successful complete
configuration read. A read failure retains the previous configuration and is
logged. A lost registry watch can prevent later changes from being observed.
Verify which interface gets a name #
A query selects one scope. The order is exclusive scope, longest matching search domain, matching reverse subnet, default route, then lowest metric among up scopes with servers. Fallback servers are considered only when no earlier step chooses a scope.
An exclusive scope must be at addressed or better. It still wins without
servers; upstream work then becomes unavailable rather than using another
interface. At link alone, the exclusive rule does not apply. Verify the
interface state as well as its flags when diagnosing VPN name routing.
A bare name such as printer requires a search domain. All up scopes can
contribute domains, including scopes without servers. A qualifying exclusive
scope supplies only its own domains. With no applicable domain, a bare name
is answered locally as not found and is never sent upstream unchanged.
See the routing and search expansion chapters for tie-breaking and failure behavior.
Static names #
With registry write access, add a static name when this machine should answer it without DNS. Replace the sample address with the intended host:
Verify both directions. Static names apply without a cache flush after the
configuration is read. Synthetic localhost names take precedence over static
names. The synthetic-name
chapter
describes hostname, reverse, and .local handling.
The resolv command #
resolv query reports individual records and where the answer came from.
resolv lookup returns addresses and a canonical name. resolv reverse
queries names for an address. resolv status reports scopes and counters.
resolv flush clears the shared cache and requires the resolver control
right. Registry editing has separate permissions. Every command exchange
has a ten-second deadline; a failed exchange is not evidence that a name
is absent. See resolv(1) for scripting contracts.
Not found versus unavailable #
| Observation | Next check |
|---|---|
notfound from DNS or cache | Check spelling and compare a query without cache lookup. |
notfound locally for a bare name | Check applicable search domains. |
unavailable | Check the selected scope, its servers, and reachability. |
| netd disconnected, no scopes | Check netd; only local answers and configured fallbacks are available. |
| netd disconnected, scopes listed | These are the last snapshot, not a fresh view of the links. |
| A demoted server | Check its failures; healthy servers are tried before demoted ones. |
| A stale answer | Check static overrides, then compare a query without cache lookup. |
| Access denied | Inspect the native control permission separately from stub reachability. |
Read the service log when startup or updates fail:
A restart replaces resolvd's stale socket and clears transient state. Do not remove its runtime directory as a routine diagnostic step. Inspect permissions and the exact startup error using the failure guide.
Three doors #
Programs reach the same resolver engine through the native socket, the local
DNS stub at 127.0.0.53, or glibc's Name Service Switch (NSS) module.
Native applications can use libresolvd.so; other DNS clients use the
constant resolver configuration pointing at the stub.
A direct query to another server tests that server and bypasses normal scope selection. It does not establish how Peios applications resolve the name.
Implementation boundaries {#what-is-not-there-yet} #
resolvd does not implement DNSSEC validation, DNS over TLS, multicast DNS,
or per-program resolution policy. Answers report unvalidated. Allowed
callers use the same policy; native query access controls permission to ask.
Going deeper #
- PSPU, Name Resolution Interface, defines the protocol contract. defines request and outcome contracts.
- resolvd TRM explains the implementation and its limits.
- netd's resolver channel describes the live network information sent to resolvd.
Changing Network Policy
Peios / Using Peios / Network Policy
Peios Network Policy uses registry rule trees under
Machine\System\Network. netd applies Interface rules; the kernel's NTFE
applies RawPacket, Packet, and Flow rules. The two consumers validate
their own layers independently.
Inspect, change, and verify #
- Establish the intended connection and listener. An allow rule does not start a listener or grant its port reservation.
- Record
net statusand, with kernel-device access,net policy. Distinguish a stored rule from the accepted generation. A refused update keeps the previous accepted configuration active. - Preview the smallest change. Network Manager offers configuration tools, but its labeled example activity data is not evidence of a real flow.
- Preserve old values and local recovery access before changing a remote connection's path. Rule and network-label changes can affect established connections on their next packet.
- Write the intended policy, then run
net policy waitandnet policy. Checknet statusseparately for interface/profile acceptance and test the actual service connection.
Read Changing Network Settings for exactly which desktop changes have a keep/undo countdown. Direct registry edits and the development PNP viewer do not provide that safeguard. A timeout or refusal from the acceptance check needs investigation.
Choose the evaluation layer #
Use Flow for most connection and service policy. Packet evaluates
per-packet conditions, including traffic without a tracked flow. RawPacket
works at wire-side seats; its available facts differ. An allow in one layer
does not override a refusal in another. Interface selects a profile,
leaves an interface alone, or keeps it down.
Rules have conditions, actions, and inherited priority. A matching child is an exception within its parent tree; separate trees still compete. Highest priority wins, then the stricter verdict. An effect such as counting does not grant access. The shared authoring reference defines the vocabulary; the kernel's evaluation reference defines execution.
Check a changing flow #
A flow's cached verdict is its sentence. Its direction follows the originator,
including replies. Policy or network-context changes cause reevaluation on
the next packet. Consulted Time.* conditions can also expire a sentence;
Start.* describes connection start and stays fixed. Loopback has two local
endpoints and must pass both judgments.
Use native Local.* facts for a local program or service. They derive from
socket identity stamps, not a claimed process name or a projected Unix UID.
Missing identity can mean a kernel endpoint, shared receivers, or no listener.
The identity reference explains
when each fact exists.
DROP is silent. REJECT(Refused) resembles an unavailable listener;
REJECT(Prohibited) reports policy refusal. Some packets cannot receive a
refusal, so the engine counts a degraded drop. A newly rejected established
TCP flow can be torn down at both ends. Kernel-generated refusal packets
have a specific bypass; ordinary traffic does not inherit it.
Interpret observations #
Generation zero is permissive before policy ingestion. An accepted empty packet forest has a drop backstop; an unmatched interface is ignored. Record which state the machine is in before interpreting a missing rule.
A cached sentence produces no fresh evaluation event for each packet. Missing events do not prove delivery, and captured frames can precede a later drop. Check surfaced capture loss, verdict overwrite, and refusal counters alongside flow attribution.
Network Rule Authoring
Peios / Using Peios / Network Policy
Rule paths live beneath Machine\System\Network\Rules. Interface belongs
to netd; RawPacket, Packet, and Flow belong to NTFE. Each executor can
accept or refuse its own generation independently. A successful registry
write is not an acknowledgment from either executor.
A rule's name identifies it in diagnostics and cannot contain path separators.
Its conditions are ANDed. A matching child specializes its parent's matched
region. Priority inherits from the parent, or defaults to zero at a root.
An empty action list abstains; Enabled = 0 disables the subtree.
Conditions #
Condition names have the form <Fact>.<Operator>. Missing facts do not match,
except through an explicit presence test. Integer operands accept documented
numeric types or decimal text; integer lists accept ranges. Unsupported
operator/type combinations reject the generation.
| Operator | Families | Value |
|---|---|---|
Equal | all | Membership: a scalar, or a list (REG_MULTI_SZ) meaning any of. Integers accept a-b ranges; addresses accept CIDR prefixes and (IPv4) a-b ranges. |
GreaterThan | integer | A single integer; strictly greater. |
LessThan | integer | A single integer; strictly less. |
Has | flags | A flag name or list; all listed bits set. |
Hasnt | flags | A flag name or list; all listed bits clear. |
Present | all, and Tag.<name> / Counter.<name> | 1: the fact exists for this packet or flow; 0: it does not. The one operator that looks through the absent-fact law. On a fact its layer never has, it refuses the generation rather than becoming an always-true condition. |
Fact vocabulary #
Availability depends on the layer and the actual subject. A condition using
an unavailable fact cannot make a connection pass. A Present test for a
fact that the layer never supplies is rejected. Native endpoint identity
comes from the socket's effective-identity stamp, not a name supplied by the
application.
| Fact | Family | Values | Present when |
|---|---|---|---|
Direction | string | in, out | always. Flow: the originator's side, for the flow's whole life |
Interface | string | interface name, for example, eth0 | always. Flow, outbound: the route's device |
EtherType | integer | number, or ipv4, ipv6, arp | always. Not a Flow fact (a flow's family is its addresses') |
SrcMac | MAC | aa:bb:cc:dd:ee:ff | frame has an Ethernet header; at the IP seats outbound, the machine's own device address |
DstMac | MAC | aa:bb:cc:dd:ee:ff | frame has an Ethernet header. Not a Flow fact |
Vlan | integer | VLAN id | the frame is VLAN-tagged (device seats) or the interface is a VLAN device (IP seats) |
SrcAddr, DstAddr | address | exact (10.0.0.5, fd00::1), CIDR (10.0.0.0/8, fd00::/64), IPv4 range (10.0.0.1-10.0.0.99) | IP packet |
Protocol | integer | number, or tcp, udp, icmp, icmpv6, sctp | IP packet |
Ttl | integer | TTL / hop limit | IP packet. Not a Flow fact |
Dscp | integer | 0..63 | IP packet. Not a Flow fact |
Fragment | integer | 0 or 1 | IP packet (only ever 1 before defragmentation, that is, at the RawPacket seat). Not a Flow fact |
SrcPort, DstPort | integer | 0..65535 | TCP, UDP, or SCTP |
TcpFlags | flags | FIN, SYN, RST, PSH, ACK, URG, ECE, CWR | TCP. Not a Flow fact |
IcmpType, IcmpCode | integer | ICMP / ICMPv6 type and code | ICMP or ICMPv6 |
Length | integer | packet length in bytes at the seat (stack view) | always. Not a Flow fact |
FlowState | string | new, established, related, invalid, untracked | Packet layer at its proper seat; never at the RawPacket or Flow layers |
Related | integer | 0 or 1: the flow was expected by another (an ICMP error for a live flow, FTP data) | Flow layer only |
Time.Year, Time.Month, Time.DayOfMonth, Time.DayOfWeek, Time.Hour, Time.Minute, Time.Second | integer | wall clock, UTC; DayOfWeek is ISO (1 = Monday .. 7 = Sunday) | always. In Flow, a consulted condition expires the sentence at its next flip |
Start.Year, Start.Month, Start.DayOfMonth, Start.DayOfWeek, Start.Hour, Start.Minute, Start.Second | integer | the wall clock when the flow began, UTC | Flow layer only; fixed for the flow's life, never expires a sentence |
Local | string | program, kernel, shared, none: what stands at this machine's end of the flow | Flow layer only; always present there |
Local.User | SID | S-1-5-19, or a well-known name (SYSTEM, LocalService, NetworkService, Everyone, Administrators, Users, …) | Flow, Local is program |
Local.Group | SID set | SIDs or well-known names; any of the token's enabled groups (deny-only groups are invisible; the logon SID is among them) | Flow, Local is program |
Local.Integrity | integer | a level, or untrusted, low, medium, high, system | Flow, Local is program |
Local.Confinement | SID | the confinement SID | Flow, the program is confined |
Local.Capability | SID set | any of the confinement's capability SIDs | Flow, the program is confined |
Local.Service | SID | a service name (resolvd), or its S-1-5-80-… SID | Flow, the program is a service |
Local.Process | string | the process GUID, 8-4-4-4-12 hex (case-insensitive) | Flow, Local is program |
Remote, Remote.* | as Local | the other end of the flow, when it is on this machine too | Flow, loopback flows only |
Interface.Kind | string | wired, wireless, loopback, tunnel, bridge, other | Interface layer only; always |
Interface.Id | string | the stable interface id (the inventory key name) | Interface layer only; always |
Interface.Mac | MAC | aa:bb:cc:dd:ee:ff | Interface layer only; the interface has a hardware address |
Interface.Path | string | bus position, for example, pci-0000:00:03.0 | Interface layer only; it is hardware |
Interface.Driver | string | kernel driver | Interface layer only; it is hardware |
Network.Id | string | the network record's key name under Networks\ | every layer: a network has been identified on the interface the packet crossed (see the network context) |
Network.Name | string | the operator's Name on the record | every layer; the record has one |
Network.Trust | string | the operator's Trust on the record | every layer; the record has one |
Network.Kind | string | the Interface.Kind the network was seen on | Interface layer; a network has been identified |
Tag.<name> | integer | the flow tag's value | the flow carries the tag (Packet and Flow layers; never RawPacket) |
Counter.<name>[(...)] | integer | a counter view, see below | the packet has the view's key facts and a cell exists |
Actions #
Names are case-insensitive. An action list can combine effects and a verdict;
effects do not themselves authorize traffic. Unknown expressions or invalid
operands reject the generation. PROMPT has no handler transport in the
implemented engine and applies its fallback immediately.
| Expression | Species | Meaning |
|---|---|---|
NULL | abstention | Nothing. A rule whose actions yield no verdict abstains. |
PASS | verdict | This layer approves. |
DROP | verdict | Refuse silently. |
REJECT / REJECT(Refused) | verdict | Refuse; look like nothing is listening — TCP RST, else ICMP port-unreachable. |
REJECT(Prohibited) | verdict | Refuse; say policy did it — ICMP admin-prohibited for every protocol. |
PROMPT(Handler[, Fallback]) | deferral | Ask a userspace handler; on no answer apply Fallback (an action expression, nesting up to 4 deep). No handler transport exists in this release: the fallback applies immediately and the prompt is recorded. |
TAG(Name, Set[, n]) | effect | Set flow tag Name to n (default 1). |
TAG(Name, Add[, n]) | effect | Add n (default 1) to the tag; an absent tag counts as 0 first. |
TAG(Name, Clear) | effect | Remove the tag; it reads as absent afterward. |
COUNT(Name[, n]) | effect | Emit n (default 1) into stream Name. |
COUNT(Name, Length) | effect | Emit the packet's byte length — the bandwidth primitive. |
REPORT(level) | effect | Emit an ntfe.verdict.reported audit event, level 1..5, if the level clears CurrentReportingLevel. One report per rule per evaluation, at the highest level listed. |
JOIN(profile) | verdict, Interface layer | Bring the interface up and stand in the named profile: a path under Profiles\, using either path separator. |
IGNORE | verdict, Interface layer | Never touch the interface; something else owns it. |
DOWN | verdict, Interface layer | Keep the interface administratively down. |
Interface actions are limited to its verdicts, NULL, and REPORT.
JOIN requires an existing profile; a disabled profile causes abstention.
Conflicting equal-priority profile choices have special startup/reload
handling in netd's judgment
reference.
Counter and tag references #
Counter.<name>(window, key) reads a stream written by COUNT. A window is
seconds, minutes, hours, or days, at most one day; omission selects a
cumulative total. A key selects SrcAddr, DstAddr, Interface, or a
+-joined combination; omission selects a global cell. For example,
Counter.dns(10s, SrcAddr) reads a per-source ten-second view.
A view requires some rule to write its stream. Sliding windows use eight buckets and can be stale by an eighth of a window. Matching reads the state before the current evaluation's effects, so a count does not affect its own threshold check. Missing cells and tags remain absent, rather than reading as zero in every condition.
Tag dependencies can only flow upward through RawPacket, Packet, and
Flow; downward dependencies reject the generation. Tags survive policy
generation changes. The kernel's store
reference owns capacity, lifetime, and
refusal accounting.
Executor references #
| Question | Owning reference |
|---|---|
| Profile values, inheritance, and accepted offers | Configuring Profiles and netd's registry manual |
| Interface fact and action rules | Interface judgment |
| Packet seat order and available facts | Seats and dispatch and snapshot |
| Validation, rule limits, and reporting level | Policy ingestion |
| Priority, abstention, and effects | Evaluation |
| Cached verdicts, time changes, and refusals | Flow layer |
| Native endpoint identity | Identity facts |
Image seeds add ordinary, deletable rules; this reference does not promise which services an image exposes. DHCP and router discovery need policy too. Inspect installed rules and their accepted generation before changing them. For worked packet-policy patterns, see Authoring Packet Rules.
Network Utility Compatibility
Peios / Using Peios / Network Tools
These contracts describe the Peios package recipes, not a promise that every image contains each utility. Use the installed manual for exact options. Begin diagnosis with Checking Connectivity. The tools retain the invoking native token; installing one grants no extra privilege, port reservation, or packet-policy exception.
Probe and inspect #
| Tool | Purpose | Boundary |
|---|---|---|
ping | ICMP echo | Ordinary IPv4/IPv6 echo uses datagram sockets; raw modes have separate authority checks. |
tracepath, traceroute, mtr | Route, path MTU, and latency evidence | Ordinary UDP and echo-datagram modes need no raw-socket privilege; other modes can require it. |
ss | Socket inspection | Numeric UIDs are compatibility projections, not native owner identities. |
dig | Query a chosen DNS server | Direct queries do not change resolvd configuration. |
nc | TCP/UDP communication | OpenBSD implementation with Debian portability patches; optional TLS mode is not built. |
tcpdump | Live capture or saved-capture decoding | Live packet access needs native authority; ordinary file read access suffices for saved captures. |
arping | Local-link ARP probes | Uses packet authority and does not trace routed paths. |
nmap | Targeted host/service inspection | Connect mode and raw-packet modes have different authority requirements. |
Ordinary echo does not use a POSIX group-range setting to authorize callers.
PNP still evaluates its traffic. Raw and packet sockets require enabled
SeTcbPrivilege; a tool's behavior-selection flag cannot confer it. MTR can
fall back to echo datagrams when raw sockets are unavailable.
Nmap selects probing behavior using native privilege rather than projected
UID zero. -sT -Pn requests TCP connect probing without raw host discovery;
--privileged and NMAP_PRIVILEGED only select behavior. Its scripts retain
the caller's authority. User data lookup uses an absolute $HOME/.nmap with
normal FACS checks. Ncat and Nping are not included by this recipe.
tcpdump rejects Unix -Z identity dropping because a numeric UID change does
not reduce native authority. Launch it with the intended native token.
Capture filters select observations, not allowed traffic, and a captured
frame can still be rejected elsewhere in the stack.
Named libpcap savefiles and Nmap logs are created with protected owner-only native descriptors. Existing destinations must be regular, singly linked, owned by the effective principal, and provably protected for that owner. Rotation follows the same creation rule. Streams supplied by a caller, stdout, shell redirection, and script-owned file operations instead follow their own destination policy. A private file does not protect its directory entry from a principal authorized to replace it.
Transfer and relay #
curl uses OpenSSL's system trust paths. Cookie, HSTS, and Alt-Svc saved state
receives a private descriptor for the effective principal at creation, with
no fallback to Unix mode bits. Equal projected UIDs do not confer access.
State output requires a regular writable destination; ordinary downloads
use normal destination policy. wcurl uses curl for file downloads.
socat supports TCP, UDP, Unix sockets, files, PTYs, process execution, and OpenSSL TLS. It starts only explicitly requested listeners or children, under the caller's token. Unix ownership, mode, umask, identity-switch, chroot, and network-namespace options are rejected rather than presented as native isolation. TUN, POSIX message queues, readline, and libwrap are excluded. Regular relay output uses ordinary FACS policy. Select the expected TLS identity and anchors for a private service explicitly.
For synchronized contents and private cryptographic output, use Copying Contents and Checking TLS.
Registration and throughput #
whois follows registration-server queries and referrals under normal PNP
rules. Its recipe excludes mkpasswd and IDN conversion: supply ASCII or
already converted punycode. /etc/whois.conf can override server selection.
For a measurement between cooperating hosts, start iperf3 -s on the
receiver and iperf3 -c HOST on the sender. UDP, reverse direction, and
parallel streams use -u, -R, and -P. The default port is 5201; the
server
needs native bind authority and policy for control and test traffic.
Installation starts no measurement service.
iperf3 uses anonymous in-memory payload buffers. Received -F output and PID
files use protected owner-only creation and validate existing regular,
singly linked destinations before truncation. Send-side inputs use ordinary
read checks; logs and redirected output use their destination's policy.
Optional RSA authentication restricts measurement access but neither creates
a Peios logon nor encrypts measured traffic. Protect private keys and the
server's authorized-user file separately.
Copying Contents and Checking TLS
Peios / Using Peios / Network Tools
Choose the intended identity and destination policy before running a transfer or generating secret output. These instructions apply to the Peios ports; ordinary upstream builds do not establish the native-file guarantees below.
Synchronize contents #
-
Identify the source and destination. Use a destination directory you control and preserve any contents that replacement could discard.
-
For recursive contents, symbolic links, and modification times, adapt:
-
Verify the resulting contents and native descriptor.
-Xadditionally copies ordinaryuser.*attributes, not descriptors, signatures, or other security attributes, even with explicit attribute filters.
New files use destination inheritance; updates retain the destination's
complete descriptor. Unix owner, group, and mode are not native authority.
Archive/security-preservation requests such as -a, -p, -o, -g,
--chmod, ACL preservation, and --fake-super are refused. This is not a
native security backup or restore mechanism.
Ordinary replacement uses an unnamed temporary inode in the destination filesystem. Publishing requires permission to read and restore the entire destination descriptor, including audit metadata. Unsupported staging or insufficient rights fail without silently falling back to in-place writes. The destination inode/descriptor check and final rename are not one atomic security transaction; coordinate concurrent permission changes separately.
If the interruption and hardlink tradeoff is appropriate, explicitly choose
rsync -rlt --inplace source/ destination/. This retains the inode and its
descriptor but changes its other hardlinks too. Interruption can leave partial
contents. It is not an equivalent retry after a staged update was refused.
Alternate staging, partial/backup modes, delayed updates, hardlink preservation, basis-directory optimization, special-file preservation, batch mode, and unsafe symlink traversal are excluded. Replacement that would delete an object to change its type or link target is refused; deletion is a separate decision. Daemon serving is disabled, including over a remote shell, while normal SSH server-side transfers remain available. SSH supplies the recipient identity. Client password files need protected owner-only native policy.
Create private cryptographic output #
OpenSSL uses trustd's generated trust paths by default. Per-command CA files,
directories, or environment overrides select different trust without
modifying the machine store. Use trust for machine trust; do not rehash its
generated directory independently.
- Choose a directory you control and the intended effective principal.
- Use the command's named output option for secret material: for example,
the applicable
-out,-keyout,-secret,-sess_out, or-keylogfile. - Confirm success and inspect the resulting native policy before arranging any intentional service sharing.
Private keys, secret-bearing PKCS12 exports, session/key-log files, derived
or random key material, RNG state, and decrypted plaintext use protected
owner-only creation. Mixed exports are treated as potentially secret; public
certificate/key output uses ordinary destination policy. Existing secret
outputs must be regular, singly linked, owned by the effective principal,
and provably protected for that owner. Refusal does not fall back to 0600.
Shell redirection creates its own destination. openssl ... > key.pem does
not obtain the tool's named-output guarantee. Administrative privileges and
mandatory controls still apply to native private files.
Verify a TLS peer #
openssl s_client reports certificate errors without necessarily stopping.
For a strict check, require verification success and the intended identity:
Replace the host with the service being tested. For an IP identity, use
-verify_ip. SNI alone is not hostname verification. Inspect a failed chain,
name, or trust check rather than disabling verification to obtain success.
A successful certificate check does not grant network access or change
machine trust; listeners and connections remain subject to native policy.
File Sharing
Peios / Using Peios / Sharing Folders
Peios can share folders with Windows, Mac and Linux computers on your network. People reach a shared folder from their own computer's file manager and work with its files as if they were local, signed in with an account on the Peios machine. If you have used file sharing on Windows, this will be familiar: Peios speaks the same protocol, SMB, and uses the same model of shares, share permissions, and file permissions.
The file server is fservd, a service that peinit runs. You manage it with
the File Sharing window or the fserv command.
Shares #
A share offers one folder on this machine under a name, such as
Projects for /srv/projects. A Windows user reaches it as
\\peios-box\Projects, and a Mac or Linux user as
smb://peios-box/Projects, where peios-box is this machine's name on the
network.
A share is defined once and switched on for each protocol it is served over. SMB is the only protocol so far, and a new share is served over it unless you say otherwise. Removing a share stops offering the folder; the folder and its files stay exactly where they are.
Shares live in the registry under Machine\Software\Fservd\Shares. fservd
watches the key, so a change applies to new connections within a few
seconds, without restarting anything. People already connected keep the
share they connected to until they disconnect.
Browsing to the server, such as opening \\peios-box in File Explorer,
lists the shares the person browsing can use: fservd tries each one as
them, so nobody sees the name of a share they can't open. An administrator
can list every share to everyone instead, with Show every share in the
File Sharing window or fserv listing all. A share whose name ends in $
is never listed, but people who know its address can still open it.
Signing in #
People who connect sign in with an account this machine knows, such as a local account. The client proves it knows the account's password with NTLMv2, and fservd passes that proof to authd, which checks it against the account. fservd never sees the password. A successful sign-in creates a logon session for the person, as signing in at the console does, except that its logon type is Network.
fservd doesn't accept guest sign-ins, or the older LM and NTLMv1 proofs. Every signed-in session is signed, so a message changed on its way across the network is refused. Traffic is not encrypted, so share sensitive files only over networks you trust.
A client can sign its session in again without disconnecting, as Windows does on long-lived connections, and may switch to another account as it does. Files already open stay open with the access they were granted; everything after that is done as the new account. When a client reconnects after its network drops, it names its earlier session, and fservd closes that session's files first if it belongs to the same account, so nobody is locked out of their own files by a connection that is already gone.
Anonymous connections #
Some devices, such as scanners and media players, connect without signing
in. Every share refuses them unless you turn on Allow anonymous for it,
in the share's Network Access in the File Sharing window, or with
fserv share set <name> --anonymous on. Browsing the server anonymously
shows only the shares that allow it.
An anonymous connection acts as the Anonymous identity. It belongs to Everyone but not to Authenticated Users, and has Untrusted integrity, so it can use only files and shares that grant Everyone access, and it can't change anything labelled above Untrusted, which by default is everything. The Read-only for everyone signed in and Administrators can change; others read restrictions refuse it, since they grant signed-in people only. An anonymous session's messages are signed only if the device asks, and then with keys anyone can work out, so a message changed in transit isn't reliably detected.
Who can do what #
fservd acts as each signed-in person for every file operation: when someone opens a file through a share, the kernel checks the file's own permissions against that person's token, exactly as it would for a program they ran on this machine. A file someone couldn't read at the console, they can't read through a share either.
A share can also have its own network access, a security descriptor that limits what people can do through that share. When someone connects, fservd checks the share's network access; every file they then open is limited to what it granted. Network access only ever narrows the files' own permissions. It can make a share read-only for everyone, but it can't let anyone change a file whose permissions refuse them.
A share with no network access of its own leaves the decision to the files' permissions alone. That is the default, and it is usually what you want: the folder's permissions already say who can use the files. Add network access when the network should be more restricted than this machine, as described in Restricting Network Access.
Files in use #
When a Windows program opens a file it can say what others can do with the file while it has it open: read it, change it, or delete it. On Peios the kernel keeps those rules for everyone, so they apply to programs on this machine as well as to other people on the network. A program here that tries to change or delete a file someone has open without allowing it gets a "device or resource busy" error until they close it.
Deleting works as it does on Windows: a file deleted while others have it open keeps its name until the last of them closes it, and can't be opened again meanwhile.
File attributes #
Windows gives files attributes such as read-only and hidden. Through a share they work like this:
- Read-only is a Peios attribute too, so it sticks. A read-only file
can't be changed or deleted, by anyone, on the network or on this machine,
until the attribute is cleared;
attrib -rclears it here. - Hidden follows the Linux convention: a file or folder whose name starts with a dot is shown as hidden. Marking another file hidden from Windows has no lasting effect.
- Created is the file's creation date. Copying a file onto a share keeps its original date, and Windows can change it. Peios also keeps the date the file system created it, which nothing can change.
- Archive always shows as set on files, and changes to it aren't kept.
A backup that copies only files with Archive set, such as
robocopy /Morxcopy /M, copies every file each time. - Not indexed is kept as the file's PGSS Indexing preference, the
user.pgss.indexingattribute thatattrib +isets here: setting it from Windows keeps the file's contents out of search, and clearing it removes the preference. A folder's preference covers everything inside it, but Windows shows it only on the folder itself. On a file system that can't keep it, it's accepted and not kept. - Temporary is accepted from Windows and not kept.
- Extended attributes, the name and value pairs some Windows programs
attach to files, are kept as Linux extended attributes named
user.followed by the name in capitals, sogetfattrshows them here. Linux programs' ownuser.attributes appear to Windows the same way, exceptuser.peios.ones, which Peios reserves, and the indexing preference, which appears as not indexed. Peios standards'user.pgss.attributes, such as a file's icon, keep their lower-case names when Windows writes them back.
What is recorded #
fservd records an event when someone sets up a session, connects to a
share, signs in again, or their session ends, and when its configuration is
loaded. Each
records the client's address and the person's security identifier.
fservd.session.started carries the logon session that authd created, so
you can join it to authd's authd.logon.attempted record and to the
kernel's audit records of the files that person opened. Run
evman fservd.share.connected to see what each event holds, and see
Diagnosing File Sharing
for queries.
For the command and its options, read fserv(8); for the service, read
fservd(8). Every registry value is documented by regman: run
regman 'Machine\Software\Fservd'.
Sharing a Folder
Peios / Using Peios / Sharing Folders
Share a folder when people on other computers need to open and save its
files. When you finish, the folder is reachable from Windows, Mac and Linux
computers by an address such as \\peios-box\Projects.
Before you start #
- Sign in as a member of Administrators. Only Administrators can change shares.
- Make sure the folder exists, and that its permissions let the people who will use it open its files. Sharing a folder doesn't change its permissions: File Sharing explains why.
- Each person who connects needs an account on this machine.
Share a folder with the File Sharing window #
- Open File Sharing from the launcher. From a terminal,
fserv --windowopens the same window. - Choose Share a folder in the sidebar.
- In Folder, type the folder's full path, such as
/srv/projects, or choose Browse… to pick it. - In Name, keep the suggested name or type another. The name is part of the address people type, so a short name without spaces is easiest.
- Leave Network access set to No network restriction, unless the share should be more restricted than the folder's own permissions.
- Choose Share Folder.
The new share's page shows its addresses under Connect, and the file server's state is on the Service page. If the file server is stopped, choose Start, and turn on Start when Peios starts so the share is available after every restart.
Share a folder with the fserv command #
-
Add the share:
-
If the file server isn't running, start it, and make it start at boot:
fserv share add refuses a folder that doesn't exist, a name another share
already has, or a name with characters that SMB doesn't allow, such as /
or :. Read fserv(8) for every option.
Check the result #
Run fserv share show with the share's name:
The output includes SMB on, the access, and the addresses to connect to:
Share Projects
Folder /srv/projects
SMB on
Access No network restriction
Windows path \\peios-box\Projects
Mac/Linux smb://peios-box/Projects
fserv status shows whether the file server is running. Then connect from
another computer, as described in
Connecting to a Share.
Stop sharing a folder #
On the share's page in File Sharing, choose Stop Sharing…, or run:
The folder and its files stay where they are. People already connected keep the share until they disconnect.
Connecting to a Share
Peios / Using Peios / Sharing Folders
Connect to a share to open and save its files from another computer. You sign in with your account on the Peios machine, not the account on the computer you are using.
Before you start #
- Get the share's address from its administrator. It looks like
\\peios-box\Projectsfor Windows, orsmb://peios-box/Projectsfor a Mac or Linux. Or browse to the server,\\peios-box, to see the shares you can use. - Know your account name and password on the Peios machine.
- Your computer must support SMB 3.1.1. Windows 10 and later, current versions of macOS, and Linux with a recent kernel or Samba do.
- If your computer can't find the Peios machine by name, use its IP
address in place of the name, as in
\\192.0.2.10\Projects.
Connect from Windows #
- Open File Explorer.
- Type the share's address, such as
\\peios-box\Projects, in the address bar, and press Enter. To choose from the shares you can use, type the server's address,\\peios-box, instead. - When Windows asks for network credentials, type your account name and password on the Peios machine.
To give the share a drive letter, choose Map network drive from the
This PC menu, or run this in a terminal, replacing alice with your
account name:
net use Z: \\peios-box\Projects /user:alice
Windows asks for the password, then shows the share as drive Z:.
Connect from a Mac #
- In Finder, choose Go › Connect to Server.
- Type the share's address, such as
smb://peios-box/Projects, and choose Connect. - Choose Registered User, and type your account name and password on the Peios machine.
Connect from Linux #
Most Linux file managers connect to an smb:// address. In GNOME Files,
choose Other Locations, type smb://peios-box/Projects in Connect to
Server, and sign in with your account name and password on the Peios
machine. Leave the domain as it is: the Peios machine ignores it.
Check the result #
The share's folder opens, and you can open its files. What you can do with each file depends on its permissions on the Peios machine, and on any network restriction the share has.
If the connection is refused, see Diagnosing File Sharing.
Restricting Network Access
Peios / Using Peios / Sharing Folders
Restrict a share's network access when people should be able to do less over the network than on this machine, such as only reading files they could change at the console. A share's network access only ever narrows the files' own permissions; to let someone use files they can't use now, change the files' permissions instead.
Before you start #
-
Sign in as a member of Administrators.
-
Decide whether a preset fits. Most needs are one of these:
- No network restriction: each file's own permissions decide. This is the default.
- Read-only for everyone signed in: nobody can change files through the share.
- Administrators can change; others read: only Administrators can change files through the share.
Both restrictions grant signed-in people only, so they refuse anonymous connections even on a share that allows them.
Choose a preset #
In File Sharing, open the share's page, and choose Use beside the
preset under Network Access. Or run fserv share set with the preset's
name, open, read-only or admins-change:
Choose specific people and groups #
- In File Sharing, open the share's page.
- Under Network Access, choose Choose… beside Specific people and groups.
- Choose Add… to add the people and groups who can use the share, and give each Read, Change, or Full control. Remove the entries for anyone who shouldn't use it, including Authenticated Users, which a share without a restriction starts with. To admit anonymous connections on a share that allows them, grant Everyone instead.
- Choose OK.
From the command line, give the share a security descriptor in SDDL. This one lets Administrators change files and every signed-in person read them:
The rights are read (0x1200A9), change (0x1301BF), and full control
(0x1F01FF). To name one group, put its security identifier in place of
AU.
Check the result #
Run fserv share show Projects. Access names the preset in use, or says
Custom network permissions. The change applies to new connections within
a few seconds; anyone already connected keeps the access they connected
with until they disconnect.
Connect as someone the share should restrict, and try the change it
should refuse. A share that grants someone nothing refuses their connection
outright, and fservd records fservd.share.connected with
access-denied.
Diagnosing File Sharing
Peios / Using Peios / Sharing Folders
Diagnose a file-sharing problem when someone can't reach a share, can't sign in, or can't open or change its files. fservd records each step of a connection as an event, so the records usually say which step failed and why.
Before you start #
- Sign in as a member of Administrators, so you can read the events and the file server's log.
- Note the time of the failure, and the address of the computer that failed, if you know it.
Check the file server #
Run fserv status. Service should be active, and Shares should
count the share as on SMB. If the service is stopped, start it with
fserv service start. A warning such as
fserv: warning: share Old: Path is missing names a share that can't be
used; fix it with fserv share set, or remove it.
If a client can't connect at all and fservd records no
fservd.session.started, check that the firewall admits SMB: net policy
should show the smb flow rule, which passes inbound TCP port 445. fservd's
package adds it; a rule an administrator wrote that refuses the port, or a
missing rule, stops every connection before it reaches fservd.
Read the connection's events #
List the last hour of fservd's events:
A connection produces fservd.session.started when the person signs in,
then fservd.share.connected for each share they open. Each record has
the client's address in source.address. Show only failures:
Then read outcome.reason on the failed record:
| Event | Reason | What to do |
|---|---|---|
fservd.session.started | authentication-failed | Read authd's record, below |
fservd.session.started | not-ntlmv2 | Sign in with an account, not as a guest, using NTLMv2 |
fservd.share.connected | no-such-share | Check the name, and that SMB is on for the share |
fservd.share.connected | access-denied | The share's network access grants this person nothing, or they connected anonymously and the share doesn't allow it |
Run evman fservd.session.started for every reason and field.
Find out why a sign-in failed #
authd records every sign-in it handles as authd.logon.attempted:
Its outcome.reason says whether the account name or password was wrong
(authentication-failed), the account is restricted, or the account isn't
allowed to sign in over the network (logon-type-not-permitted). authd never
records the account name a failed sign-in gave.
When someone can connect but can't use a file #
fservd acts as the person for every file operation, so a file they can't
open over the network is usually one they couldn't open at the console
either. Check the file's permissions on this machine first. If those allow
the operation, check the share's network access: fserv share show with
the share's name shows it, and a restriction such as Read-only for
everyone signed in refuses every change.
To record exactly which file access the kernel refused, add an audit entry
to the folder's descriptor. Every record of the person's file access then
carries the same subject.token.auth-id as the object.session.id on
their fservd.session.started record.
Read the file server's log #
fservd writes a line to its log for each share it serves when it starts, and for each share it can't use:
Check the result #
Ask the person to connect again. A successful connection records
fservd.session.started and fservd.share.connected with
outcome.success true.
Filesystem Layout
Peios / Using Peios / Files and Volumes
The base layout separates packaged files, local overrides, generated output, and mutable state. Images and local mounts can differ. A path alone does not prove persistence, a separate storage budget, a backup policy, or permission to remove its contents.
| Location | Purpose |
|---|---|
/usr | Packaged executables, libraries, helpers, shared files, and defaults. |
/lcl | Operator-managed software and file-based overrides. |
/system/retc | Generated configuration projected into the runtime /etc view. |
/var/state | Persistent service and identity state, including protected secrets. |
/var/cache, /var/log, /var/crash | Component-managed caches and diagnostic data; event records need not be text files here. |
/home | Human home directories. Services use their configured state paths. |
/data, /srv, /opt | Bulk data, served content, and software with its own layout. |
/run | Runtime sockets, service directories, and locks. |
/tmp, /var/tmp | Temporary work; check the actual mount and cleanup policy. |
/boot, /system/boot | Boot inputs, the EFI mount, and generated boot artifacts. |
/mnt, /media | Mount locations; creating a directory does not attach storage. |
/proc, /sys, /dev | Kernel and device interfaces. |
Follow the runtime view #
The conventional /bin, /sbin, /lib, /libexec, /share, /include,
and /conf views place local directories above vendor directories. The
real-root /etc view additionally puts /system/retc above /lcl/etc and
/usr/etc. An existing generated name can therefore hide a local override.
Find the owning registry setting before editing generated output.
The +ro flag protects a stratum through that view; it does not make direct
access to the backing /usr path universally read-only. On the reviewed
x86-64 base, /lib64 is a relative link to usr/lib/x86_64-linux-peios, not
a
StrataFS mount. The /lib view still covers modules and firmware. Temporary
boot views can differ from real-root views.
Use StrataFS inspection to identify the actual provider before changing a file. Removing a local override can reveal a vendor file; it does not create a whiteout.
Default policy is not a live inventory #
The retained fsbase recipe supplies these policy intentions. Later package, service, installer, or administrator changes can narrow them further. Inspect the deployed descriptors rather than assuming a path proves access.
| Scope | Intended baseline |
|---|---|
| Public software and selected local configuration trees | SYSTEM and Administrators manage; other users receive read/traverse access where specified. |
/var/state, caches, logs, crash data, /data, and /srv | Administrative control with traversal where specified; no universal read grant to service contents. |
/home | Traversal without a general directory-list grant; each home supplies its own policy. |
/tmp and /var/tmp | Shared creation with creator-specific child policy, not inherited public access to every temporary file. |
/var/state/secrets | SYSTEM-only baseline. |
| Identity stores | The owning service and SYSTEM; for example, lpsd's credential store has its own narrower policy. |
These are not interchangeable repair templates. In particular, applying a
public system-tree descriptor recursively to private state exposes data.
/lcl/policy holds privileged boot policy and is not ordinary override
storage.
The retained installed layout uses a disk-backed /tmp without automatic
boot clearing in fsbase. A live image's volatile layer has a different
lifetime. Check actual cleanup and mount configuration before relying on
reboot to erase a file. Check which EFI filesystem is mounted before replacing
boot artifacts; generating an image elsewhere does not activate it.
Identifying Devices
Peios / Using Peios / Files and Volumes
Before a mount or destructive operation, compare the selected device's size,
model, partition layout, and live use. Kernel names such as /dev/sda and
/dev/nvme0n1 can change with discovery order.
| Identity | What it follows |
|---|---|
| Filesystem UUID | The filesystem; a clone can duplicate it. |
| Partition UUID | The partition table entry, independently of its filesystem. |
| Hardware ID | The device's advertised serial or worldwide identity. |
| Bus path | The device's position in the hardware topology. |
| Label or partition label | A human-selected name that need not be unique. |
| Disk sequence | An instance in this boot, not a persistent reference. |
The device manager exposes applicable links under /dev/disk/by-*. Check the
resolved target, especially when clones are attached. A stable name does not
prove that erasing the target is appropriate.
Do not assume those links exist in an initramfs without the device manager.
A boot hook can resolve root=UUID= by probing devices directly. Check the
image's actual discovery path. A real-root service depending on the links
needs the appropriate device-manager dependency, plus handling for removal
or discovery failure.
Device naming does not authorize opening the node. Its security descriptor and operation-specific checks still apply. Interface renaming similarly provides a configuration name, not proof of network identity or trust.
Mounting Storage
Peios / Using Peios / Files and Volumes
Inspect the device, existing mounts, and intended target before attaching
storage. Use lsblk, part list, and mount, retaining diagnostics
alongside
the listings. Limited visibility does not prove a disk is unused.
Choose the missing-descriptor behavior #
| Policy | Purpose |
|---|---|
| Deny missing | Use provisioned storage with valid stored descriptors. |
| Ephemeral synthesis | Derive missing descriptors without saving those derived values. |
| Persistent synthesis | Adopt missing descriptors incrementally through deferred write-back. |
A valid stored descriptor remains authoritative. A corrupt one is refused rather than replaced through synthesis. Unmanaged policy is reserved for kernel-owned cases; it is not an administrative way to disable file security. StrataFS has a fixed policy.
Synthesis considers parent inheritance, then the mount template, then the kernel fallback. Omitting a template does not mean private access. Persistent synthesis is not a whole-tree conversion, and a readable cached descriptor does not prove it reached storage. Before moving to deny-missing, verify the stored descriptors of rarely used files as well as ordinary working files.
The kernel mount reference owns defaults and administration, while descriptor storage owns synthesis, corruption, deferred write-back, and repair. tmpfs, devtmpfs, and boot images do not all default to ephemeral synthesis.
Verify the attachment boundary #
Policy belongs to the superblock, not the mountpoint. Bind paths can share it; a second mount of the same device need not create an independent policy. A policy change neither rewrites stored descriptors nor revokes cached rights on existing handles. Other filesystems mounted below it remain separate.
mount(1) documents attach-time policy and template options. Policy is set on
the detached mount before attachment, so failure at that step does not expose
a mount with unintended policy. Other setup can still have happened before a
later failure. A nonzero status is not proof that no state changed.
Remount and bind operations are not policy-change interfaces. Disk Manager's inspection does not make its unimplemented privileged commit workflow usable. Changing policy on an existing instance requires a supported integration with the kernel API. The narrower volume-management privilege can satisfy that API's gate; do not add TCB merely because a command diagnostic names it.
Read-only mounting and ephemeral synthesis are separate choices. An ext
filesystem can replay its journal even on a read-only mount. For preservation,
use an inspection method that also prevents journal and device writes, such
as the installer's documented read-only loop and noload procedure.
After attachment, verify source, target, filesystem, writable state, policy, and template. Missing policy details leave verification incomplete. Reopen files when checking a changed policy instead of testing through old handles.
Arrange startup deliberately #
Prelude's hooks mount the root before Peinit. Additional storage can use a service with an explicit identity, privileges, dependencies, and failure policy. A service using device-manager links must wait for those links, and must still handle later device removal.
Define repeat-start and partial-failure behavior. A successful Oneshot service can become inactive while its mount remains attached; service state is not live mount state. Do not use an option that lacks an existing-mount guard as proof of idempotence. Verify both the service result and the mount itself.
Mount Operations and Their Boundaries
Peios / Using Peios / Files and Volumes
mount attaches a filesystem or changes an existing mount. With no operands,
it reads live mount state rather than attaching anything.
Source, target, and policy are separate choices #
A source identifies the storage or filesystem being mounted. A target is where its contents become visible. A mount policy controls how the Peios access model treats objects on that filesystem.
A new filesystem's policy is set before attachment. Failure to set that policy prevents attachment with an unintended policy. This does not make the whole command transactional: target creation or later propagation changes have their own effects.
Bind mounts share a source filesystem rather than copying it. Superblock options can affect shared state, while per-mount attributes concern the selected view. The command rejects superblock changes in a bind remount instead of silently changing every view of the filesystem.
Inspect live state before and after a change #
This implementation does not use /etc/fstab to supply missing operands or
/etc/mtab as its source of truth. It reads the kernel's mount table. Listing
and attachment are different modes, so a listing filter is not necessarily a
valid attachment type expression.
A filesystem probe can refuse an ambiguous device rather than choosing between conflicting signatures. Inspect the source and resolve ambiguity before attempting an attachment.
Failure is not a rollback report #
A propagation change can fail after a filesystem has been attached. A nonzero status therefore does not establish that the target stayed unchanged. Retain diagnostics and inspect the live mount before retrying.
The accepted --onlyonce flag is not enforced by the executor. It does not
make repeated invocation idempotent. Check existing attachments explicitly.
Fake mode skips mount syscalls, but target preparation can still create directories. It does not prove that a real operation will pass authorization or filesystem checks. A requested mkdir mode is not a verified Peios security descriptor; establish the target's security separately.
Keep storage lifecycle visible #
Regular-file images can need loop devices. The command can allocate or reuse suitable loop backing, and newly allocated loops use automatic cleanup. That mechanism does not make an image safe to modify through uncoordinated concurrent access.
mount(1) defines source syntax, policy restrictions, loop handling,
namespace selection, and status codes. The filesystem's own documentation owns
its specific parameters.
Detaching a Mounted Filesystem
Peios / Using Peios / Files and Volumes
umount detaches a filesystem from the mount tree. Its operand can name a
mount point or a source resolved through live mount state.
Name the intended attachment #
A source mounted at several locations is ambiguous. Name the particular mount point when only that attachment should be removed. All-targets mode is an explicit request to expand the operation to every matching mount.
Recursive mode expands beneath a target and works from deeper mounts upward. Expansion can stop on a failure, leaving a partially changed tree. Inspect what remains before retrying.
Detachment and final cleanup can differ #
An ordinary unmount can fail while resources are busy. Lazy unmount removes the attachment from the visible tree while deferring cleanup until references are released. It is not a guarantee that every user has stopped using the filesystem or that a device is ready to remove.
Forced unmount is another distinct request whose meaning depends on the filesystem. Read-only fallback changes state instead of proving a detach. Use the mode that matches the recovery task, rather than escalating flags until a command returns success.
Check the resulting state #
The command reads /proc/self/mountinfo, including after entering a selected
mount namespace. A query in another namespace can show a different set of
attachments.
An aggregate failure can coexist with successful top-level operands.
umount(1) defines ambiguous-source handling, expansion stopping rules, loop
cleanup, and the status distinctions.
Inspecting Storage Devices
Peios / Using Peios / Files and Volumes
lsblk shows block devices and their relationships. It helps distinguish a
whole disk, a partition, and a layered device before an operation uses one of
those objects.
Before you start #
Use a terminal with Peiosutils installed. For examples that create files, start in a disposable working directory without existing example names.
Perform the task #
Run the command:
Check the result #
The output shows available devices, sizes, types, and known mount points. The device set depends on the running system.
Missing information is not a negative finding #
Columns come from several sources, including kernel device information, filesystem probing, mount state, and device-node security. A source can be unavailable or unreadable even when the device exists.
An empty filesystem identity does not prove that the device is blank. Probe access can be denied, and missing optional libraries can limit the information available.
The owner and mode columns describe the device node, not the files stored inside its filesystem. Peios node security is not equivalent to a set of traditional mode bits.
For scripts, choose explicit columns and a structured output mode. The human
tree is intended for inspection. lsblk(1) defines column sources and the
representation of incomplete information.
Partitioning a Disk
Peios / Using Peios / Files and Volumes
part manages GPT partition tables. Begin with its read-only inventory and
verification commands, and identify the whole disk by more than its transient
device name. An unreadable inventory entry is not an empty disk.
Plan the EFI and root partitions, or the data layout required by the intended consumer, before writing. Partition changes can destroy access to existing filesystems. Preserve needed data and unmount the target's filesystems first. The whole-disk and mounted-device guards remain relevant even when replacing an unfamiliar table is explicitly allowed.
Creating a table, adding an entry, and deleting an entry are separate changes. The tool does not resize filesystems, relocate data, install a bootloader, or supply an undo transaction. A newly added partition is not yet a formatted or secured filesystem.
After a successful write, verify the table and confirm that the kernel sees the intended partition devices before formatting. A valid table does not prove an existing filesystem fits an edited entry. Use the installer for its supported whole-disk workflow rather than reconstructing that workflow from isolated partition commands.
part(1) owns size units, type aliases, confirmation flags, alignment, table
recognition, and exit status. In particular, a bare size is a sector count;
use an explicit unit when expressing a byte-sized plan.
Inspecting StrataFS
Peios / Using Peios / Files and Volumes
Use stratafs to inspect the current mount namespace before changing a merged
path. It does not elevate the caller or modify files. An incomplete protected
view fails rather than pretending to be a complete answer.
The stack lists strata in precedence order. A path can have one provider, merged directory participants, shadowed same-type objects, masked different types, or an absent entry. The origin report names the actual providers; write and delete reports explain routing, not authorization.
A write can happen in place, copy up to the create stratum, or create a new object. Symlinks, immutable state, missing parents, and read-only strata can change that answer. The attempted operation still performs its own checks.
Review local overrides #
Use sweep on a mount to find objects in its create stratum, then diff on a
selected override before deciding whether to retain it. A gap exists only
locally; an override has a lower counterpart; a shadowed entry is hidden by a
higher object or ancestor. Directory overrides can still merge contents.
Deleting a local object can reveal the lower object because StrataFS does not
use whiteouts. The +ro flag prevents modification through the view, not all
direct writes to the backing tree. Neither a sweep result nor a routing report
is permission to remove the listed paths.
Diagnose a security or copy-up failure #
StrataFS requires stored descriptors under its fixed deny-missing contract. A lower mount's synthesis does not repair a missing stored descriptor for the view. Copy-up preserves the source's full descriptor; ordinary creation uses inheritance. A failed preservation step fails copy-up. Do not apply overlayfs assumptions to this implementation.
A stale copy-up after provider changes can require reopening. A successful
open does not guarantee the first write succeeds. Use the kernel's
StrataFS documentation for provider identity,
copy-up, and failure semantics. stratafs(1) owns output states, JSON limits,
and probe-oriented exit codes.
Disk Manager
Peios / Using Peios / Files and Volumes
Disk Manager displays disks, partitions, mounts, and startup mounts. Use it to inspect the machine's storage layout. Its change forms do not modify storage because the privileged disk-service backend is not implemented.
What is shown #
A disk page lists its model, capacity, device, partition table, and partitions. The bar represents each partition's share of the disk and marks free space. Opening a partition shows available filesystem, label, identifier, usage, and mount information.
Mounts lists active mounts, their options, and available access-policy information. At Startup shows configured startup mounts. StrataFS views include their constituent strata when readable.
Disk Manager samples every two seconds. It reads block information, the kernel mount table, filesystem statistics, and permitted policy data. Some raw-device and policy details need additional privileges. Unreadable information is marked rather than invented.
Before choosing a separate command that changes storage, compare the device, model, serial number, exact size, partition layout, and mount points. Not Readable and Contents unknown report missing visibility; neither means that a disk is empty or unformatted. Nonadministrative accounts can still see kernel-listed partitions even when raw-device details are refused.
A later mount can cover an earlier mount at the same point or an ancestor. Inspect the mount hierarchy when a filesystem seems to have disappeared. StrataFS lists strata in precedence order. Startup entries identified by UUID are distinct from system-managed mounts; displaying either does not enable editing it.
Reading a missing-permissions policy #
The labels describe how the kernel handles a missing security descriptor:
| Label | Policy | Interpretation |
|---|---|---|
| Deny Access | deny-missing | Deny descriptor-based access until a valid descriptor is supplied |
| Give Permissions, Not Saved | synth-ephemeral | Derive a descriptor and retain it in memory |
| Give Permissions and Save Them | synth-persist | Derive a descriptor and schedule persistence |
| Not Managed | unmanaged | No filesystem access-control check from this policy; other kernel checks still apply |
An ephemeral descriptor can remain cached with the inode. Do not interpret the UI description as a promise to derive a fresh descriptor on every open. Corrupt stored descriptors are not equivalent to absent descriptors and are not repaired by choosing synthesis. A filesystem without descriptor storage cannot persist the synthesized result.
The mount's permissions view describes its fallback template, not the access rules of every object already on that filesystem. Check the actual object when diagnosing an access refusal.
What cannot change storage #
The forms for erasing a disk, adding or removing a partition, formatting, mounting, unmounting, changing mount policy, startup configuration, and ejecting all end by reporting that nothing changed. Passing validation or confirming one of these forms is not a completed disk operation.
Use the separately documented storage tools when you need to perform an
actual operation. Their risks and access requirements belong to those
tools; do not infer them from this read-only inspection interface.
See gxwi-disk-manager(1) for data sources and limitations.
Diagnosing Storage Pressure
Peios / Using Peios / Files and Volumes
Keep the exact failing operation, path, error, and time. A read-only mount, permission denial, or I/O failure is not automatically a space problem. Start with an existing path involved in the failure, or its existing parent.
Record the filesystem, type, mountpoint, available space, inode availability, and diagnostics. Do not substitute the root filesystem's figures without checking that the path belongs to it.
Measure a narrow, authorized directory with du, retaining its errors and
exit status. A partial walk understates what it could not read. Use the
command's filesystem-boundary option when appropriate and avoid treating
merged views as independent physical copies.
Filesystem usage and directory totals need not agree. Open-but-unlinked files, metadata, reserved space, snapshots, compression, sparse allocation, hard links, and stacked filesystems can affect the comparison. A pathname survey cannot account for every allocated block.
Choose the owner's supported remedy: package cache cleanup, log retention, service data maintenance, or removal of a known expendable build artifact. A large file is not proof that deletion is safe. Do not delete package transaction journals, live databases, or boot files merely to make space.
After the separately chosen remedy, repeat the same measurements and retry the original operation. Removing a pathname can not release its storage until an owning process closes it. Record that limitation instead of escalating to broader deletion.
Managing Packages
Peios / Using Peios / Packages
Package Manager presents peipkg's package queries and transactions. It runs as your account and uses the same plans, permission checks, history, and audit records as the command-line package manager.
Before you start #
You need the package database access required for the task, a running GXWI session, and the relevant repository or package file. Reading package records and changing installed software are separate permissions.
If the package supplies a configured feature, remove the feature's setup in Feature Manager first. Keep the package installed until cleanup reaches Not Installed; its scripts are needed to undo the configuration. If cleanup fails, preserve its output and resolve the feature state before removing the package.
Review and apply a transaction #
- Open Package Manager. Use Installed, Available, or Updates to select the package and action.
- Read the plan: packages to install, update, downgrade, or remove, and the expected download and installed sizes.
- Review any separate approval for an elevated action, such as replacing unowned files or accepting a downgrade. Approve only the action you intend.
- Confirm the plan and follow progress to the final outcome. Answer a modified-configuration-file question only after reviewing that file.
Check the result #
Inspect the final outcome, warnings, and History, then verify the installed package version and intended application behavior. Check Files compares installed files with package records. A transaction that was interrupted can offer Resolve; the most recent eligible transaction can offer Undo.
After plan approval, closing the window does not cancel the transaction. The application waits for it to finish. Do not assume a lost browser connection rolled back a change.
Explicit overrides and changed files #
A refusal can offer a specific retry, not permission to ignore every check:
- Continue Anyway accepts stale repository metadata after refreshing failed to obtain newer information. That approval is recorded.
- Replace It permits an install to displace an unowned file while keeping the displaced copy. An operation without that option needs its conflict resolved separately.
- Update Anyway bypasses the publisher's alternate-update instruction. Check what that update method does before bypassing it.
- Repositories leads to explicit review of an untrusted repository's key. The application does not approve repository trust during a refresh.
For a modified configuration file encountered during removal, Keep It leaves an unowned file, Delete It removes it while keeping a copy beside it, and Stop Everything cancels the removal. Inspect the final outcome and history rather than assuming a canceled interaction undid every action.
Repositories, roles, and roots #
Repositories lists sources and offers refresh, add, trust, and removal operations. Trust requires your explicit review of the signing key; update checks refresh repositories already trusted. Stale metadata and publisher-controlled update refusals have separate, explicit overrides.
Roles shows claims and their owning packages. Installation Roots
shows named roots; creating them is a peipkg root task. Install from
File uses the shared file dialog for a .peipkg file. See
gxwi-package-manager(1) and peipkg(1).
Upgrading Peios from the Desktop
Peios / Using Peios / Packages
Upgrade Peios changes the machine's Peios release through upgrade-peios.
Package Manager handles other software updates. This window uses the same
release plan and permissions as the upgrade command.
Before you start #
You need permission to upgrade, trusted repository metadata, and a recovery plan appropriate to the release. Read the shared release-upgrade guidance before applying a machine-wide change.
Review and apply the upgrade #
- Open Upgrade Peios. Check the current release and edition package. Use Check Now to refresh already trusted repositories and request a plan without applying it.
- Read every proposed change, download size, and installed-size effect.
- Choose whether Apply Its Settings at the Next Restart should defer the release's registry seeds. Review the upgrade confirmation and any separate package approvals.
- Start the upgrade and follow it to completion. If the plan changed before execution, review the new plan before accepting it.
Check the result #
Read the final outcome and installed release state. The application does not restart the machine. If settings are deferred, verify that pending state and apply them at the planned restart. Apply Now requests their immediate application instead.
Once approved, the transaction continues to its result even if the window
is asked to close. Continue Anyway after stale-repository information
is an explicit choice to use the available metadata, not a successful
refresh. See gxwi-upgrade-peios(1) and the upgrade command's documentation.
Recovering from a refusal or incomplete result #
An untrusted repository needs confirmation in Package Manager; checking for a release does not grant that trust. When another package change holds the backend lock, wait for it to finish before trying again.
A settings-application failure does not undo an installed release. Inspect the pending seeds and the reported package result separately. Apply Now asks the release updater to apply waiting seeds; a restart also provides the configured application point.
The driven upgrade protocol reports an explicit cancellation separately from completion. A canceled result stops before release seeds are staged or applied. Already completed backend effects are not a general rollback transaction.
An installed package version does not establish which kernel or services are running. Follow the shared release-upgrade activation checks before relying on the update. The desktop provides a result display, not proof that all changed software has restarted.
Stored Records
Peios / Using Peios / Reading Records
eventd stores events, logs, and metrics so that you can inspect what a Peios machine recorded. Each kind answers a different question and has a different delivery guarantee.
The stores hold these records:
| Kind | Contents | Delivery |
|---|---|---|
| Events | Structured records from kernel rings | Sequence receipts and detected-loss records |
| Logs | Text with an origin and output-stream flag | Best effort through the trusted output broker |
| Metrics | Numeric samples identified by names and labels | Best effort with publication authorization |
A metric series combines a name with its labels. Samples from different label sets belong to different series even when they share a name.
Producers and record meaning #
Service output reaches eventd through peinit's output broker. A log retains
its origin, stream, and run context. Hooks and health checks can have their
own origin suffixes under the service name; jobs have job identifiers. A
service attached through TTYPath writes to its terminal instead of that
capture path. Standard error identifies a stream, not necessarily an error.
Read Service Output and
Logging for capture and
backpressure behavior.
Structured events identify a type and carry fields defined by its event
catalog. Use evman to interpret those fields rather than inferring identity
or causation from the event name. A kernel ring is volatile; eventd supplies
stored history within collection and retention limits.
Counters describe accumulating quantities, gauges describe changing levels,
and histograms describe distributions. Compare samples within the same label
set and account for producer restarts before interpreting a counter's rate.
eventd publishes its own health under eventd.*.
Use Event Viewer for interactive
inspection, or query records with
evctl. Its read policy is the same boundary for either client.
Visibility #
Queries run with the caller's socket identity. eventd checks access to record names and individual fields before returning data. It omits denied records and fields without announcing their existence. An empty result therefore does not establish that nothing happened.
Use the query client rather than opening the databases directly. Direct file access bypasses eventd's query authorization.
Retention and loss #
Stored history is finite. Retention removes old records and can remove records to meet configured size limits. Kernel event rings can overwrite records before eventd reads them; log and metric sockets can drop input. A successful send is not a persistence acknowledgment.
The eventd.events.lost event describes detected missing event sequences.
It cannot reconstruct their payloads. eventd.store.quarantined describes
a corrupt database moved aside. Use the eventd evman records to interpret
the fields of either event.
See Finding Missing Records when a result differs from what you expect.
Interpreting Events
Peios / Using Peios / Reading Records
An event records an observation: an access check completed, a service started, or a package changed. Its type identifies the observation, and its fields describe it. Read the definition before drawing conclusions from a record or from its absence.
Find the definition #
Each component supplies event and field definitions in .evman files under
/usr/share/evman. The event manual reads those
installed definitions. Consult the catalog shipped with the producer's
version when interpreting older records.
An event definition describes its trigger, tier, field presence, and any meaning specific to that event. A field definition supplies its general type and vocabulary. A group names fields that travel together. The catalog can define fields that no current event carries; a definition alone is not proof that a producer writes the field.
The catalog format defines how components maintain these records. Event and field lookup belongs to the catalog, rather than a separately maintained table in Learn.
Some components also describe their events in their manuals, where an event's meaning depends on the mechanism behind it:
- The kernel's access control subsystem describes its audit records in Event Families and Delivery. The registry's Audit page and StrataFS's Audit page describe theirs. The kernel's Emission Policy page describes how it decides which event types to write.
- eventd describes the events it writes about itself in Synthetic Event Payloads.
- Authentication Events describes the logon, attestation, and credential events of authd and lpsd.
Identify the transport and origin #
KMES carries kernel and userspace events in shared per-CPU rings. The kernel
adds the event's sequence, CPU, timestamp, and identity stamps. Userspace
chooses its event type and payload, so a kernel-looking type name does not
establish a kernel origin. Check emitter.class and distinguish the stamped
identity from identities asserted inside the payload.
emitter.token.guid identifies the effective token at emission;
emitter.true-token.guid identifies the primary token before impersonation.
emitter.process.guid identifies the process instance. A null identity stamp
must remain unknown. It does not identify a privileged caller. Read the
kernel event model for the stamp and
wire-layout contract.
Some records use other paths:
- eventd inserts its own operational events into its store. They have no KMES sequence or kernel-stamped emitter identity.
- LCS watch records report registry changes through a key file descriptor. They have their own binary format and are notifications, not KMES events or an audit trail.
- Logs and metrics use separate ingestion paths and stores. Their delivery guarantees differ from event collection.
A KMES identity stamp is kernel attribution, not a cryptographic signature. It does not authenticate the truth of an arbitrary payload or provide non-repudiation for an exported record.
Decode fields according to their definitions #
A dotted payload path describes nested MessagePack maps: subject.token.sid
means the sid key inside token inside subject. It is not a literal
subject.token.sid key at the top level. A path cannot be both a value and a
container for other fields.
Read absence against the event's declared presence: required, optional, or conditional. Do not replace an omitted value with zero, an empty string, or nil. Required data missing from a record needs investigation; optional data missing from it establishes no value.
Types carry units and wire representations. SIDs, GUIDs, and ACEs use binary values; time and duration values use nanoseconds. Masks need their object kind. Parallel arrays must be interpreted together. Resolve principal names for display while preserving the original SIDs. The value conventions define the complete table.
Consumers should ignore unknown fields and retain unfamiliar values from open enumerations. Closed enumerations and field types have stronger contracts. The extension rules distinguish additive changes from vocabulary changes that require a new version. Successful transport decoding does not prove catalog conformance.
Account for loss and ordering #
A reader has its own position in each shared ring; it does not receive a private buffer. Writers can overwrite unread events. Slow readers do not block other readers or the producer, and overwritten records cannot be recovered from KMES. A later attachment can still read records that remain in the ring.
Sequence establishes order within a CPU for one boot. Keep CPU and boot context with it. Wall-clock adjustments and different CPUs prevent timestamps from establishing a total causal order across the machine.
eventd persists the records it receives and reports detected sequence gaps. Collection, storage failure, retention, filtering, and authorization can all limit what a query returns. Follow the missing-record workflow before treating an empty result or a gap in a filtered display as proof of what happened.
Querying Records
Peios / Using Peios / Reading Records
Use evctl to read events, logs, and metrics from a terminal. It sends one
query to eventd and writes only the records that the caller can read.
Before you start #
Before querying:
- Install the
evctlclient and start the configured eventd service. - Use an identity permitted to read the requested records.
- Choose the record kind and time range needed for the investigation.
Run a query #
- Select an
EVENTS,LOGS, orMETRICquery using the observability query language in the Peios userspace protocols specification (PSPU). - Pass the complete query as one quoted argument to
evctl. Quoting prevents the shell from expanding patterns or splitting strings. - Read standard output for records and standard error for diagnostics. Check the exit status before treating a finite result as complete.
For exact flags, output formats, and exit statuses, read evctl(1).
The default socket is /run/eventd/query.sock; --socket selects the
configured path when the deployment uses another location.
Simplify an expression that exceeds the limit #
eventd rejects expressions deeper than 128 levels with the query error
expression depth exceeds 128 levels. The limit applies separately to
nested grouping parentheses and to the structure built from AND and
OR predicates. A long flat chain can exceed the limit even without
parentheses.
Remove redundant grouping and simplify the predicates before retrying. The rejection is a query error, not an empty successful result. Check standard error and the exit status as you would for another query error.
Check completion #
For a finite query, evctl holds the initial records in a temporary spool
until eventd confirms completion. A query failure before that confirmation
publishes none of those records. Copying a completed spool to the output
can still fail and leave partial output.
A streaming query confirms its initial result before publishing it, then prints live records as they arrive. A later failure does not invalidate records already published. Restarting the query starts a new query; it does not resume an acknowledged cursor.
An empty successful result means that no matching, readable records were returned. It does not prove that every record remains available.
Event Viewer
Peios / Using Peios / Reading Records
Event Viewer reads this machine's records from eventd. It separates Events, Metrics, Logs, and Settings, and performs queries as your account. The backend filters records according to their read policy.
Events and logs are displayed newest first. A list starts with the newest 200 records; Show older adds another 200, and a window holds at most 1,000. Pause keeps the list still and Resume continues updates. Selecting a row shows its available fields.
Event filters narrow by type and source. Log filters narrow by origin,
text, or errors. Metrics use named dashboards of charts rather than the
row list. Dashboard preferences are personal and stored under
CurrentUser\Software\gxwi-event-viewer.
Interpreting missing records #
A missing event is not proof that it did not occur. Retention, query filters, time range, and access policy all affect the result. Event Viewer tries to read the policy and explains known hidden names. When that policy cannot be read, it reports that some data could be hidden rather than claiming complete visibility.
The Settings tab edits eventd configuration and read policy only where access permits it. It uses eventd's registry manual for meaning, defaults, ranges, and application timing. The viewer's dashboard schema belongs to its own registry manual.
See Reading Events and Logs and
gxwi-event-viewer(1).
Reading Events and Logs
Peios / Using Peios / Reading Records
Use Event Viewer to find a recorded event or a service's logs. Narrow the query enough to inspect the relevant records, then retain the context needed to interpret them.
Before you start #
You need Event Viewer, a running eventd query service, and access to the records. Know the approximate time, origin, or event type involved.
Find a record #
- Open Event Viewer and select Events or Logs. Services Manager's Logs action can open the selected service's origin.
- Set the relevant type or source for events, or origin and text filter for logs. Use the errors-only filter when that matches the question.
- Select Pause if new rows make inspection difficult. Select a row to inspect its full visible fields.
- Use Show older to extend the displayed history and Resume when you want live updates again.
The initial time range is the last 24 hours. Select a range containing the incident before paging backward; any time removes the time restriction but cannot restore records removed by retention. Apply typed filters with Enter or Apply. An errors-only filter selects standard error, which is not proof that each selected line reports a failure.
If following stops, preserve the notice before selecting Show the newest. Resuming at the newest records does not establish what happened in the gap. Use Copy on relevant rows to preserve their visible fields with the job, boot, time range, and filters.
Check the result #
Read the record's time, type or origin, and fields, together with any
visibility note. A list is bounded to 1,000 rows, so use a narrower query
or evctl when your investigation needs a different range or query shape.
If eventd refuses the connection, address that refusal rather than treating the empty display as a result. If records remain absent, check the filter, retention, and read policy before concluding that nothing was recorded.
For a systematic check of scope, access, retention, and collection failures, follow Finding Missing Records. Keep a visibility notice with the evidence: it describes readable names or an unknown policy, not proof that hidden matching records exist.
Arranging Metric Dashboards
Peios / Using Peios / Reading Records
Event Viewer's Metrics tab lets you arrange charts into personal dashboards. A chart's time range, transformation, aggregation, and grouping change the question it asks eventd.
Before you start #
You need read access to the metric and permission to save your dashboard preferences if they should persist. Inspect what the metric measures before choosing its chart options.
Arrange a chart #
- Open Metrics and select or create the intended dashboard. Without saved dashboards, the viewer shows eventd health.
- Add the relevant metric and choose the time range.
- Select the transformation and aggregation suited to its meaning. A cumulative counter often needs a rate or delta; a measured level can use its recorded samples.
- Choose whether series are combined or displayed separately, then save the arrangement.
Check the result #
Check the chart's units, range, and series labels. A combined series can hide differences between its individual sources. A gap can indicate no sample or inaccessible data, not a measurement of zero.
Dashboard preferences allow up to 64 dashboards and 32 charts per
dashboard. Malformed saved entries are skipped. Exact storage syntax is
owned by gxwi-event-viewer.regman; eventd owns query and metric semantics.
Finding Missing Records
Peios / Using Peios / Reading Records
Check query scope and collection health before concluding that a record was never written. Keep the evidence before changing retention or removing stored files.
Before you start #
Record the incident time, service or event name, and relevant job and boot identifiers. A service restart creates another run; matching only its name can mix unrelated attempts. Preserve available records before changing retention or attempting storage recovery.
For Event Viewer controls and visibility notices, follow Reading Events and Logs. The daemon checks below apply regardless of the client.
Inspect the result #
- Check the query's record kind, name filters, and time range. A relative time range changes each time the query runs.
- Check the command's exit status and diagnostics. A connection or query error is not an empty successful result.
- Confirm the caller's identity and intended read policy. Authorization can omit records or fields without disclosing them.
- Inspect detected-loss and quarantine records when your identity can
read them. Consult
eventd.events.lostandeventd.store.quarantinedin evman for their field meanings. - Check retention and storage diagnostics. Records removed by retention or held in an excluded historical shard do not return through queries.
Interpret the evidence #
The absence of a loss record does not prove complete collection. eventd cannot count every datagram rejected by a full kernel socket queue, and a storage failure can prevent the daemon from persisting its own report.
Logs reflect text received from the output broker. Whether a service sends its output to that broker belongs to the service manager's configuration. Do not change eventd's read policy to compensate for a producer that never sent a record.
A logical retention limit is not a hard filesystem quota. SQLite can retain free pages, and write-ahead logs occupy additional disk space.
Retention and unavailable history #
Read the effective settings and their defaults in eventd's registry manual. Age and size limits are removal criteria, not a promise of minimum history. Size pressure can remove records younger than the age limit. Event retention can remove an earlier boot together with its loss records; log and metric retention remove older entries or samples.
A query timeout means the query failed to finish. It is not itself evidence that ingestion lost records. Save the error, then try a narrower time range to investigate the failing query.
A running daemon can exclude an unreadable or unsupported historical shard while serving its other stores. Inspect startup diagnostics as well as the query result. Corruption encountered during a query fails that query; quarantined stores are not silently repaired into complete history.
Current retention values cannot show which records an earlier configuration removed. Likewise, a missing loss event cannot account for the final volatile batch lost during power failure. Keep these limits with the investigation.
Preserve the store #
Do not delete live database files to make a query succeed. Preserve the query, diagnostics, timestamps, and relevant configuration, then follow the deployment's recovery procedure. Replacing a corrupt store gives the service an empty store; it does not recover lost history.
Deleting records leaves pages for reuse and does not necessarily shrink a
database file. eventd does not automatically run VACUUM. Do not treat a
logical retention setting as a procedure for repairing or compacting a live
store. Keep quarantined files intact for the administrator handling recovery.
Check the conclusion #
Record which possibilities the evidence supports: query scope, authorization, retention, collection loss, or unavailable storage. If the checks are inconclusive, retain that uncertainty. Save a completed query with its completion context instead of labeling an empty display as proof that an event never happened.
Saving Query Evidence
Peios / Using Peios / Reading Records
Keep a query result with its diagnostics and scope so that another reader can distinguish a completed capture from an empty or failed attempt.
Before you start #
Before capturing records:
- Choose a private directory and unused output filenames.
- Select a finite query without
STREAM. - Record the identity, machine, query text, time zone, and client version.
The destination directory's native security descriptor and inheritance must
restrict new files to the intended readers. A shell umask or chmod is not
a substitute for that Peios access policy. Use an existing directory you
control; ask its administrator to establish the policy if needed.
Check that both output names are unused regular-file destinations, not
existing files, symlinks, or pipes. Shell redirection can truncate a file
before the query runs. Allow space for the output and the client's temporary
spool. The process's temporary directory must be writable, suitable for
sensitive data, and support anonymous temporary files (O_TMPFILE).
Capture the result #
- Write standard output directly to the result file and standard error to a separate diagnostic file. Avoid a pipeline that can close early.
- Record the command's exit status immediately after it exits, before another command replaces the shell's status value.
- Inspect the diagnostics and mark a nonzero or interrupted attempt as failed. A failed output copy can leave part of a completed result.
- Keep the exact query, capture times, status, and diagnostics beside the result. Record any result-count limit and whether a relative time range was used.
For example, after checking the private destination and unused names:
capture_status=
This is at most 50 readable matching records since one hour ago, not all
records from that hour. The relative range moves on each attempt. Keep the
start and finish times, query, installed evctl version, and status beside
the capture. JSON Lines stores one JSON object per record.
If the shell cannot open a redirection target, the client might not run.
Preserve that error too. For a client failure, consult evctl(1) for exit
statuses and inspect both destination and temporary-storage errors. Use new
names for another attempt rather than overwriting its evidence.
evctl treats an output pipe closed by its reader as success. A pipeline
that selects only the first records therefore does not establish that the
whole query was captured. Filter a saved result after capture instead.
Check the result #
For a direct capture to a regular file, a zero status means the finite query and output publication completed. It does not establish complete system history: authorization, retention, and collection loss still bound what the result contains.
Keep the original capture private and unchanged. Permission to read a record does not automatically permit sharing it with another audience.
Finding an Event's Meaning
Peios / Using Peios / Reading Records
evman reads installed event documentation. It explains what an event records
and what its fields mean; it does not report which events occurred on this
machine.
Read the event and the field together #
An event definition describes when it is emitted and which fields it can carry. A field definition describes the field's general type and meaning. An event can add a narrower explanation for its use of that field.
Pay attention to required, optional, and conditional presence. A missing field is not necessarily malformed if the event's rules make it conditional. Likewise, a familiar field name does not imply that every event carries it.
Distinguish enumerated values from an open vocabulary #
A closed value list claims completeness under its definition. An open list can grow, so consumers need a deliberate policy for values they do not recognize.
Some common fields belong to the record header rather than the payload. Their documentation identifies that location. Do not assume that the same information appears twice.
Search the installed corpus #
Exact lookup selects a named event or field. Prefix lookup helps explore a subsystem, and keyword search matches names and summaries. Derived names can resolve through documented suffix or standard-attribute rules; read which rule supplied the result.
For example, look up an access-check event, a field, or a subsystem prefix:
The field card lists events that carry the field. Use those relationships when replacing a field-index lookup. The installed packages determine the available definitions; a missing package can mean missing documentation. For an older capture, keep the producer's version and catalog with the record rather than assuming the current definitions are identical.
Packages supply definitions under /usr/share/evman. Catalog validation
checks consistency across those definitions. A valid catalog describes an
interface; it does not establish that a particular event was recorded or that
its payload passed runtime validation.
Use the event store or Event Viewer to investigate occurrences. Use evman(1)
for lookup and catalog-validation syntax.
Inspecting the Raw Event Stream
Peios / Using Peios / Reading Records
revstrm reads KMES directly, without eventd's storage or query path. It is a
diagnostic consumer, not a durable audit sink. Use eventd for stored history
and retain its collection/retention limits when drawing conclusions.
Observe a bounded stream #
- Confirm that the caller has enabled
SeSecurityPrivilegeand the native event interface is available. Administrator membership alone does not establish that the privilege is enabled. - Run
revstrmto follow, orrevstrm --snapshotto drain available data and exit. Snapshot drains CPU rings in order; it is not an atomic cross-CPU snapshot or a request for history predating attachment. - Narrow display with repeatable
--typeglobs or--originclasses. Use--prettyto expand payloads when studying individual records. - Record loss markers and stderr with the output. A ring that falls behind overwrites old data, and display filtering does not prevent that loss.
The header gives UTC time of day, CPU, per-ring sequence, origin, and event type. It omits the calendar date and does not merge CPUs into one event order. Do not interpret a displayed sequence gap without accounting for filters.
Interpret payloads and completion #
The installed event catalog supplies field types. Known SIDs, GUIDs, masks, enumerations, timestamps, durations, and byte counts receive readable forms; unknown bits and values remain numeric. Without a matching catalog entry, field-name fallbacks are less authoritative. Malformed MessagePack falls back to a hex preview rather than becoming a decoded record.
Compact output can truncate a long payload. Pretty output expands it but can slow draining. Redirecting to a file or reducing output cost can help; neither guarantees lossless capture. Native file policy applies to the chosen destination.
Follow mode ends on interruption, output failure, or exhausted drain threads.
The implementation treats output failure as termination and can finish after
per-ring errors, so a zero exit status alone is not a complete-capture
attestation. Inspect diagnostics and loss accounting. revstrm(1) defines
its option and output details; evman explains event schemas.
Operating eventd
Peios / Using Peios / Reading Records
eventd runs as a managed service with protected store directories and a restricted service identity. Its package supplies registry seed files; installing those files does not apply their contents to the registry.
Startup configuration #
The registry key Machine\System\eventd supplies six required paths:
three store directories and three socket paths. Missing or invalid paths
prevent startup. eventd(8) and the eventd regman records describe the
command and configuration values.
The service definition runs a short --prepare-security hook as SYSTEM
before starting the daemon. That hook prepares registry authorization
defaults. The long-running service does not acquire policy-editing
permissions merely because the hook needed them.
A deployment must provision the service identity, privileges, registry configuration, and protected directories together. Copying the executable alone is not a complete installation.
Live changes #
The daemon watches configuration and applies valid tuning changes.
Invalid live changes keep the last valid setting. Store paths, socket
paths, and shard count apply at restart. Read each regman record's
applies field before planning a change.
Read policy and metric publication policy use security descriptors under
Machine\System\eventd\Security. A read grant does not grant metric
publication. Broader grants can disclose records that were already stored.
Health and storage #
The daemon writes its own eventd.* health samples directly to the metric
store. These do not pass through the publication socket. Health counters
restart when eventd restarts, so compare changes with that lifecycle in
mind.
A store-size metric measures disk use, while retention limits logical live data. A database can retain reusable free pages after deletion. Inspect both filesystem capacity and retained data when diagnosing pressure.
For implementation details, read the eventd manual.
Changing Event Viewer Policy Settings
Peios / Using Peios / Reading Records
Event Viewer's Settings tab exposes eventd's configuration and read policy. Configuration controls the service; policy controls which names and fields accounts can read. Your personal dashboards are separate preferences.
Before you start #
You need write access for the selected configuration or policy entry. Record its current value or descriptor and read eventd's registry manual. Socket and storage paths are displayed but are not editable here.
Change and verify #
- Open Settings and select the relevant configuration group or read-policy pattern.
- Read the expected type, range, default, and application timing. Enter the value and save, or use the permissions editor for a pattern.
- Inspect the result. A value outside the accepted range is refused.
- Verify the service's active behavior at the stated time. For access policy, query as the affected account rather than only as an administrator.
Pattern scope #
A pattern can cover a name and its descendants. The most specific matching
pattern wins. Removing a specific pattern exposes the broader policy; it
is not necessarily a denial. The fallback * patterns cannot be removed
through this interface.
A new pattern starts from the permissions that already apply to its name and changes only when the descriptor is applied. Confirm the intended scope before adding a broad grant or deny. Use eventd's own documentation for the precise access model and configuration semantics.