3 Operations Command Reference
Every LynxDrive operations action lives behind one entry point: lynxdrive-ctl. No scattered system commands to memorize, no configuration files to touch.
Conventions
Three rules first: config changes, account management and service control need root — prefix with sudo; read commands without arguments echo the current value and run as a regular account; writes take effect immediately, auto-restarting the service when access is involved, usually interrupting for only seconds.
| Command | Purpose |
|---|---|
lynxdrive-ctl init [port] [user] [pass] | Rebuild initialization and the administrator account |
lynxdrive-ctl port [port] | Read or set the listening port |
lynxdrive-ctl addr [address] | Read or set the listen address |
lynxdrive-ctl root [dir] | Read or set the data root |
lynxdrive-ctl user add <user> <pass> [--admin] | Add an account |
lynxdrive-ctl user passwd <user> <pass> | Reset an account password |
lynxdrive-ctl status | Main service, watchdog and port probe |
lynxdrive-ctl info | Runtime state plus local access addresses |
lynxdrive-ctl logs [lines] | Read service logs, last 50 by default |
lynxdrive-ctl start / stop / restart | Start, stop or restart the service and watchdog |
Access Configuration
port, addr and root complement each other: without arguments they echo values; with arguments they write and restart. Ports take digits only; keep the address at 0.0.0.0 and bind a specific IP only for subnet isolation; before changing the root, re-read the reminder in the access-configuration chapter — the new directory is created and taken over, old files are not moved automatically.
Account Management
user add creates a regular account by default (basic browsing and download); append --admin for administrator rights. user passwd resets only the password, leaving permissions and other settings intact. Adding an existing account errors out — reset the password instead; a mistyped username behaves the same. Deliver credentials offline and require a change at first login.
Service Control
start, stop and restart act on both the service and the watchdog. After stop the page is instantly unreachable — fits short maintenance. restart is the first move against sluggishness, but not a routine one: if it's needed several times a day, find the root cause as in the watchdog chapter.
State and Logs
status prints the service, watchdog, port, root and port probe — ideal for records; info appends access addresses — ideal for forwarding; logs defaults to the last 50 lines, logs 200 reads the last 200, including watchdog checks and restarts.
Rebuilding Initialization
init exists for delivery and recovery. On a running system it detects the existing initialization and exits without touching data; only an explicit FORCE=1 lynxdrive-ctl init truly rebuilds — resetting access configuration and the administrator password. Use it only for device handover, factory reset or full environment rebuild, and confirm file data is backed up first. The environment variables LX_ADDR and LX_ROOT preset the listen address and data directory during a rebuild.
Errors and Scripting
Every command reports failures with an [错误] prefix and a non-zero exit status, so scripts can branch on the return value. After changing any setting, run status once to confirm the port probe is healthy before notifying colleagues of the new address.