Services & daemons
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
The Services section of a server (/servers/:id/services) is where you control
the processes that keep the box running. It has two tabs: System services —
systemd units like Nginx, PHP-FPM, MariaDB and Redis — and Daemons —
long-running application processes (queue workers, custom scripts) kept alive by
Supervisor. It’s available on all plans.
Restart a service, step by step
Section titled “Restart a service, step by step”- Open the System services tab (the default). Each row is a systemd unit with its status, memory, uptime and PID.
- Hover the row — the status badge swaps to an action group. Click Restart (or Start / Stop depending on the current state).
- The row shows a spinner while
systemctlruns, then flips to the new status. The agent re-pushes its inventory so memory, uptime and PID refresh a moment later.
To dig deeper, click Details (the eye icon) to open a drawer with the process facts, an Auto-start on boot toggle, and a live tail of the unit’s journal.
What else you can do
Section titled “What else you can do”System services tab
- Filter and search — filter by status (All / Running / Stopped / Failed) and search across service name and description.
- Start / Stop / Restart any managed unit from the row’s hover actions or the details drawer.
- Toggle auto-start on boot — the details drawer switch runs
systemctl enable/disable. - Read the journal — the details drawer tails the last ~60 lines of the unit’s journal, colour-coded by level.
- Refresh — ask the agent to re-scan and re-push the current service state.
- MariaDB opens its own unified manage hub (config + runtime + logs) instead of the generic details drawer.
Daemons tab
- Add daemon — register a long-running command (name, command, run-as user, working directory, process count, autostart/autorestart). Supervisor keeps it running and restarts it on crash.
- Start / Stop / Restart a daemon from its card.
- View logs — tail the daemon’s stdout in a drawer (last ~200 lines).
- Edit — change the command, user, directory or process count. The name is fixed once created (delete and recreate to rename).
- Delete — stops the process and removes its Supervisor config.
- Search across daemon name and command.
How it works
Section titled “How it works”Actions on both tabs dispatch jobs to the server’s agent, which runs them natively:
| Action | Job | Agent runs |
|---|---|---|
| List services | services inventory | reads the systemd unit state |
| Start / Stop / Restart / Enable / Disable | service.action | systemctl <action> <unit> |
| Service journal | service.logs | journalctl -u <unit> |
| List daemons | daemons inventory | supervisorctl program state |
| Create / edit daemon | daemon.create | writes a Supervisor program config |
| Start / Stop / Restart daemon | daemon.action | supervisorctl <action> mz-<name> |
| Delete daemon | daemon.delete | removes the Supervisor config |
| Daemon logs | daemon.logs | tails the program’s stdout log |
Both lists paint instantly from the control-plane inventory cache (the agent pushes
services and daemons snapshots), so the page loads without waiting on a live
call. Mutations run live and the agent re-pushes the affected inventory, so the UI
self-corrects within a second.
System services are limited to an allowlist of units MZPanel manages — Nginx,
MariaDB, redis-server, Docker, cron, SSH, fail2ban, every phpX.Y-fpm, plus
extension services (PostgreSQL, MongoDB, Memcached, Supervisor, BIND, Varnish,
Netdata, ClamAV). Anything outside that set is neither shown nor actionable, so a
stray click can never touch an arbitrary system unit. Each panel-created daemon is a
Supervisor program named mz-<name>, kept separate from any Supervisor programs you
manage by hand.
CLI & automation
Section titled “CLI & automation”Every action maps to an mz command on the box — the same engine the dashboard
drives. SSH in and run them directly, or let an on-box AI (ClaudeCode) run them:
mz service list --json # every managed unit + its statemz service restart nginx --json # start | stop | restart | enable | disablemz service logs php8.3-fpm --lines 100 --json # tail a unit's journalmz daemon create --name queue-default \ --command "php artisan queue:work --tries=3" --user www-data --jsonmz daemon restart queue-default --json # start | stop | restartmz daemon logs queue-default --json # tail the daemon's stdoutService names must be on the allowlist above; mz service / mz daemon with no
sub-action errors. See The mz CLI and the
command catalog.
Gotchas & troubleshooting
Section titled “Gotchas & troubleshooting”- Actions need the agent online. The lists render from the last cached snapshot when the server is offline (you’ll see a preview banner), but start/stop/restart, create and live logs all require the agent to be connected.
- Only allowlisted units appear. If a service you expect is missing, it’s not in MZPanel’s managed set — that’s by design, not a bug. Extension services (PostgreSQL, Mongo, ClamAV…) show up once the extension is installed.
- A stopped service reads ”—” for memory/uptime/PID. Those are live process facts; they only exist while the unit is running.
- A bad daemon command shows up as “failed,” not a save error. Supervisor accepts the config but the process exits immediately (FATAL). MZPanel surfaces Supervisor’s own message inline — check the daemon’s Logs and fix the command or working directory, then Restart.
- Daemons can’t be renamed. The name keys the Supervisor program; change your mind by deleting and recreating.
Related
Section titled “Related”- Cron jobs — scheduled tasks on the same box.
- OS updates — package updates and reboots for the box.
- The mz CLI — driving the box from the command line.