25 lines
766 B
Markdown
25 lines
766 B
Markdown
---
|
||
title: "pm2"
|
||
type: concept
|
||
tags: [process-manager, node, ubuntu, vibe-coding]
|
||
last_updated: 2026-04-15
|
||
---
|
||
|
||
## Definition
|
||
Node.js 进程管理器,提供进程守护、日志管理、开机自启功能,适合生产环境长期运行 Node 服务。
|
||
|
||
## Core Mechanism
|
||
- 安装:npm install -g pm2
|
||
- 启动:pm2 start "command" --name <app-name>
|
||
- 日志:pm2 logs <app-name>
|
||
- 保存:pm2 save(保存当前进程列表)
|
||
- 开机自启:pm2 startup systemd -u <user> --hp <home-dir>
|
||
- 进程列表:pm2 status
|
||
|
||
## Use Case
|
||
管理 Ubuntu Server 上的 Vibe-Kanban Web UI 进程(PORT 9999),确保服务持续运行并开机自启。
|
||
|
||
## Connections
|
||
- [[pm2]] ← 管理 ← [[Vibe-Kanban]]
|
||
- [[OpenCode Executor]] ← spawn by ← [[Vibe-Kanban]]
|