AKStream.Next · 文档中心

`akn` Global Management Command Guide

akn Global Management Command Guide

akn is the unified operations entry point installed with AKStream.Next. It delegates to the manager for the active deployment model: systemd on Linux, launchd on macOS, Windows SCM on Windows, and Docker Compose on the Docker host. Operators no longer need to remember the installation directory or run a stale script from an extracted release.

See the complete online-upgrade guide for formal-package prerequisites, page steps, status, and rollback behavior.

flowchart LR
    A[Administrator runs akn] --> B[Detect active deployment model]
    B --> C[systemd · launchd · Windows SCM · Docker Compose]

Where akn Is Installed

Deployment Registration Run it from Managed target
Native Linux /usr/local/bin/akn Linux host terminal AKStream.Next, NodeAgent, and managed MediaServer services
Native macOS /usr/local/bin/akn macOS host terminal LaunchDaemons and managed MediaServer
Native Windows akn (manager directory added to machine PATH); the directory is added to machine PATH A newly opened CMD or PowerShell AKStream.Next Windows services
Docker /usr/local/bin/akn or ~/.local/bin/akn for the installing operator Docker host; use the installing WSL distribution with Docker Desktop The selected AKStream.Next Compose stack

The installer only replaces an existing akn carrying the AKStream.Next management marker. It stops on an unrelated name collision instead of overwriting another program. Open a new terminal after a Windows or user-level Docker PATH change.

Quick Reference

akn info
akn status
akn upgrade <formal-package>
sudo akn admin-password status
sudo akn admin-password reset
akn start
akn restart
akn stop
akn verify-recovery
akn uninstall
akn help

Docker also supports akn update for a saved source or image workflow. Installers use upgrade for formal-package transactions and do not build release packages on production hosts.

Exact Command Semantics

Command Behavior Impact
akn info Summarizes installed/running versions, node and cluster identity, roles, deployment/performance profile, endpoints, database type, key paths, recording roots, and health Read-only; passwords, connection strings, tokens, and keys are never printed; Docker requires daemon access
akn status Checks the main service, NodeAgent, and /health; Docker also shows Compose state Read-only
akn upgrade <package> Validates a higher formal package for the current platform/RID, creates a transaction backup, switches and accepts it, and rolls back on failure Intentionally interrupts page, APIs, media, and Agent; native root/Administrator or Docker daemon access required
akn admin-password status Shows super-administrator enablement, failures, lockout, last login/password change, and hash scheme Read-only; plaintext never exists; native root/Administrator or Docker daemon access required
akn admin-password reset Reads the replacement twice without echo, applies the production password policy and hash, clears account lockout, rotates the security stamp, revokes sessions, and writes a security audit event Existing administrator sessions are invalidated; native root/Administrator or Docker daemon access required
akn start Starts dependencies in order and waits for health Restores service
akn restart Restarts the main service, waits for health, then validates the Agent and managed MediaServer Brief interruption
akn stop Stops AKStream.Next, managed MediaServer, and NodeAgent; Docker stops the Compose stack Service interruption
akn update Rebuilds and restarts a Docker development/self-built deployment from its saved source or image input Docker only; no formal-package transaction validation or automatic rollback
akn verify-recovery Actually terminates the main process/PID 1 and verifies the platform's declared recovery owner; Linux verifies NodeAgent after the main control connection is lost Intentional interruption; maintenance window only
akn uninstall Interactively chooses between retaining data and complete cleanup Service interruption; complete cleanup is irreversible
akn help Displays the complete help for the active deployment manager Read-only

Upgrade from a formal package

upgrade validates version, platform and package integrity first. Failures stop the operation and return diagnostic results; follow the reported rollback outcome if the new version is unavailable.

Deployment Command example Formal package format
Linux sudo akn upgrade ./AKStream.Next-1.0.0.136-linux-arm64.tar.gz .tar.gz for linux-x64 or linux-arm64
macOS sudo akn upgrade ./AKStream.Next-1.0.0.136-osx-arm64.tar.gz .tar.gz for osx-x64 or osx-arm64
Windows akn upgrade .\AKStream.Next-1.0.0.136-win-arm64.zip .zip for win-x64 or win-arm64
Docker akn upgrade ./AKStream.Next-1.0.0.136-docker-linux-arm64.tar.gz .tar.gz for docker-linux-amd64 or docker-linux-arm64

The command interrupts the current page, APIs, media sessions, and recording writes, so run it only in a maintenance window. After the terminal reports success, run akn status, confirm the version from /health, and test one real video and recording path. See the complete online-upgrade guide for preflight, backup paths, states, and rollback.

Native Linux and macOS

akn info
akn status
akn help
sudo akn admin-password status
sudo akn admin-password reset
sudo akn upgrade ./AKStream.Next-<version>-<RID>.tar.gz
sudo akn start
sudo akn restart
sudo akn stop
sudo akn verify-recovery
sudo akn uninstall

The command asks whether to retain data or perform a complete cleanup, and confirms destructive cleanup again. Use the following only for an explicitly authorized unattended cleanup:

sudo akn uninstall --purge --yes

The installed wrapper calls the version-matched manager under the AKStream.Next installation directory. Do not replace it with a symlink to an arbitrary extracted release.

Native Windows

Open a new terminal after installation. status and help can run normally; lifecycle and uninstall actions require an Administrator CMD or PowerShell:

akn status
akn help

Use an Administrator terminal for lifecycle actions:

akn start
akn restart
akn stop
akn upgrade .\AKStream.Next-1.0.0.136-win-arm64.zip
akn verify-recovery
akn uninstall

Use the same Administrator terminal for account inspection and recovery:

akn admin-password status -Username admin
akn admin-password reset -Username admin

Passwords are stored only as irreversible PBKDF2-SHA256 hashes with random salt and a server-side pepper, so akn cannot reveal plaintext that does not exist. reset reads the value twice without echo. Never place a password in command arguments, shell history, or a ticket. Automation must use a protected two-line pipe together with Unix --password-stdin or Windows -PasswordStdin.

Permanent cleanup uses PowerShell-style options:

akn uninstall -Purge -Yes

CMD and PowerShell both use akn without a file extension. The installer updates machine PATH and sends an environment notification. Close the entire Windows Terminal application before reopening it. A current CMD can reload the command directory with set "PATH=%PATH%;%ProgramData%\AKStream.Next\Tools". An existing desktop session may need to sign out after an SSH or SYSTEM installation.

Full cleanup verifies deletion. Close terminals or Explorer windows holding the installation/data directory. Deferred cleanup retries for up to three minutes and records remaining paths and errors in the diagnostic file printed by the manager; incomplete cleanup is not reported as complete.

Docker: Run akn on the Host

Docker akn is a host-side Compose manager, not an in-container command. The main application container cannot reliably stop, rebuild, and recreate itself, and mounting the Docker socket into the business container would expand the privilege boundary.

akn info
akn status
akn admin-password status
akn admin-password reset
akn start
akn restart
akn stop
akn upgrade ./AKStream.Next-1.0.0.136-docker-linux-arm64.tar.gz
akn verify-recovery
akn uninstall

Update from the saved licensed image source:

akn update

The installer records the deployment root in the wrapper, so routine commands no longer require --root. If it installs to ~/.local/bin/akn, add that directory to PATH as instructed by the installer.

Use akn upgrade for Docker formal release packages. akn update does not read a formal archive and does not provide the same backup, health-acceptance, and database-rollback guarantees.

With Docker Desktop on Windows, run akn in the WSL distribution where the Docker installer was executed. Native Windows akn manages Windows services and does not implicitly control a Docker stack in WSL. Never run lifecycle commands from a shell entered with docker exec.

If one operator manages multiple Docker roots, only one stack may own the default akn. The installer stops when the command already targets another root, preventing a short command from restarting the wrong instance. Manage additional stacks with the Docker script and an explicit --root.

Permanent Docker cleanup:

akn uninstall --purge

This deletes the Compose stack and the deployment root, including Config, MySQL, recordings, and media data. Back them up independently first.

Validating Success

Check four layers:

  1. akn status succeeds and both the main service and NodeAgent are running.
  2. GET /health returns healthy with the expected version.
  3. Readiness has no blocking database, MediaServer, or enabled-module failures.
  4. A known channel can be streamed and played; recording deployments also produce files and indices.

If a process exists but /health fails, inspect the main service logs. If /health succeeds but video does not, investigate the device, media path, playback protocol, NAT, or browser instead of repeatedly restarting the service.

Uninstall and Purge Boundary

Interactive uninstall asks whether to preserve recovery data or perform a complete cleanup. Complete cleanup removes configuration, setup tokens, keys, runtime data, and AKStream.Next-managed Nginx entries according to platform rules. --purge --yes on Linux, macOS, and Docker, or -Purge -Yes on Windows, is reserved for explicitly authorized unattended cleanup.

Do not use purge as the first response to a normal failure, bad configuration, or failed upgrade. See Backup, Upgrade, and Rollback first.