{"id":13526034,"url":"https://github.com/ntt360/pmon2","last_synced_at":"2026-01-11T23:04:28.908Z","repository":{"id":42997084,"uuid":"281075863","full_name":"ntt360/pmon2","owner":"ntt360","description":"golang进程管理工具(golang process manager)","archived":false,"fork":false,"pushed_at":"2023-12-30T05:50:04.000Z","size":14037,"stargazers_count":849,"open_issues_count":6,"forks_count":102,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-04-01T06:33:38.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ntt360.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-20T09:41:07.000Z","updated_at":"2025-04-01T03:28:40.000Z","dependencies_parsed_at":"2023-12-18T13:44:20.761Z","dependency_job_id":"c727d26f-d6cd-409c-9312-2f024c7c7db5","html_url":"https://github.com/ntt360/pmon2","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ntt360/pmon2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntt360%2Fpmon2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntt360%2Fpmon2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntt360%2Fpmon2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntt360%2Fpmon2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntt360","download_url":"https://codeload.github.com/ntt360/pmon2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntt360%2Fpmon2/sbom","scorecard":{"id":697849,"data":{"date":"2025-08-11","repo":{"name":"github.com/ntt360/pmon2","commit":"e1099b92ee713bedcb56afad58e824e075cad356"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.5,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.12.1 not signed: https://api.github.com/repos/ntt360/pmon2/releases/87872035","Warn: release artifact v1.12.0 not signed: https://api.github.com/repos/ntt360/pmon2/releases/71707258","Warn: release artifact v1.12.1 does not have provenance: https://api.github.com/repos/ntt360/pmon2/releases/87872035","Warn: release artifact v1.12.0 does not have provenance: https://api.github.com/repos/ntt360/pmon2/releases/71707258"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2021-0052 / GHSA-h395-qcrw-5vmq","Warn: Project is vulnerable to: GHSA-3vp4-m3rf-835h","Warn: Project is vulnerable to: GO-2023-1737 / GHSA-2c4m-59x9-fr2g","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T04:14:25.385Z","repository_id":42997084,"created_at":"2025-08-22T04:14:25.385Z","updated_at":"2025-08-22T04:14:25.385Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:24.526Z","updated_at":"2026-01-11T23:04:28.893Z","avatar_url":"https://github.com/ntt360.png","language":"Go","funding_links":[],"categories":["Go","应用进程管理"],"sub_categories":[],"readme":"# pmon2\ngo进程管理工具(golang process manager)，专门用于 go 常驻进程管理 （daemon manager）\n\n\u003cimg src=\"http://p0.qhimg.com/t017d6cbb68aed4b693.png\" style=\"max-width:680px\" /\u003e\n\n## 启动进程\n\n```go\nsudo pmon2 run [./二进制进程文件] [参数1]  ...\n```\n\n## 介绍\n\nGo官方一直没有提供任何进程管理工具，对于 `Go` 服务的部署，简单的服务，我们使用 `linux` 内建命令 `nohup \u0026`组合，或者使用系统自带进程管理工具, 例如 `systemd`，`init.d` 配置。或者借助第三方的进程管理工具，如：`python` 的 `supervisor` 或者 `nodejs` 的 `pm2`。\n\n每种方式都有一定优劣，我们希望继承 `go` 语言部署集成的便捷易用思想，不需要再安装其他依赖软件，并且提升进程管理工具的体验。\n\n和 `pm2` 不一样的是，`pmon2` 直接是启动的系统级常驻进程。进程直接由 `init` 来管理，因此，就算`pmon2`管理工具异常退出，也不会影响进程本身运行。\n\n默认的，`pmon2` 所管理的进程如果发生异常崩溃，`pmon2` 会尝试重启该进程。如果你不希望某个进程自动重启，那么你可以设置一个 `--no-autorestart` 参数即可。具体请参考：常用命令使用章节。\n\n\n## 如何安装\n\n目前 `Pmon2` 支持 `CentOS6`、`CentOS7`、`CentOS8`\n\n[Releases](https://github.com/ntt360/pmon2/releases) 中已经构建了可以直接安装的`rpm`包，可直接选择平台安装： \n\n```bash\n# CentOS6\nsudo yum install -y https://github.com/ntt360/pmon2/releases/download/v1.12.1/pmon2-1.12.1-1.el6.x86_64.rpm\n\n# CentOS7\nsudo yum install -y https://github.com/ntt360/pmon2/releases/download/v1.12.1/pmon2-1.12.1-1.el7.x86_64.rpm\n\n# CentOS8\nsudo yum install -y https://github.com/ntt360/pmon2/releases/download/v1.12.1/pmon2-1.12.1-1.el8.x86_64.rpm\n```\n\n:exclamation::exclamation: **注意：** :exclamation::exclamation:\n\n首次安装 `pmon2` 后，`pmon2` 服务没有自动启动，需要你手动启动该服务：\n\n```bash\n# centos6 使用 initctl\nsudo initctl start pmon2\n\n# centos7 使用 systemd\nsudo systemctl start pmon2\n\n# Debian/Ubuntu\nsudo /usr/local/pmon2/bin/pmond \u0026\n```\n\n## 命令介绍\n\n#### 查看帮助\n\n```sh\n# 查看全局的帮助文档\nsudo pmon2 help\n\n# 查看某个具体命令 help\nsudo pmon2 [command] help\n```\n\n帮助文档中能查看当前所有命令使用说明\n\n```\nUsage:\n  pmon2 [command]\n\nAvailable Commands:\n  del         del process by id or name\n  desc        print the process detail message\n  exec        run one binary golang process file\n  help        Help about any command\n  ls          list all processes\n  reload      reload some process\n  start       start some process by id or name\n  stop        stop running process\n  log         display process log by id or name\n  logf        display process log dynamic by id or name\n  version     show pmon2 version\n```\n\n#### 运行进程 [run/exec]\n\n```go\nsudo pmon2 run [./二进制文件名] [参数1] [参数2] ...\n```\n启动进程，可以传入若干参数，参数说明如下：\n\n```go\n// 进程名称，如果不传递，则以二进制文件名作为默认名称\n--name\n\n// 进程运行日志，不配置则使用默认路径：/var/log/pmon2/\n--log   -l\n\n// 仅自定义日志目录，优先级低于 --log\n--log_dir -d\n\n// 进程自定义参数，多个参数以空格分割\n--args  -a \"-arg1=val1 -arg2=val2\"\n\n// 进程启动用户\n--user  -u\n\n// 不自动重启, 默认自动重启\n--no-autorestart    -n\n```\n\n#### 示例：\n\n```go\nsudo pmon2 run ./bin/gin --args \"-prjHome=`pwd`\" --user ntt360\n```\n运行 `bin/gin` 二进制文件，并且传递参数：`-prjHome` 为当前目录，并且制定进程运行的用户为：`ntt360`\n\n!!!warning \"注意\"\n    pmon2启动的进程会另起一个隔离的上下文环境，自定义参数需要使用绝对路径，不能使用相对路径。\n\n#### 查看列表  [ list/ls ]\n\n```go\nsudo pmon2 ls\n```\n\n#### 启动进程  [ start ]\n\n```go\nsudo pmon2 start [id or name]\n```\n\n#### 停止进程  [ stop ]\n\n```go\nsudo pmon2 stop [id or name]\n```\n\n#### 重载进程 [ reload ]\n\n```go\nsudo pmon2 reload [id or name]\n```\n\n#### 插件进程日志\n\n```shell\n# 查看最近进程的日志\nsudo pmon2 log [id or name]\n\n# 动态查看进程日志，类似系统tail -f xxx.log\nsudo pmon2 logf [id or name]\n```\n\n仅仅重启配置文件，该命令需要所启动的进程配合使用，`reload` 命令默认仅仅发送 `SIGUSR2` 信号给启动的进程\n\n如果你希望 `reload` 时自定义信号，那么请使用 `--sig` 参数：\n\n```go\n// 目前支持的信号：HUP、USR1、USR2\nsudo pmon2 reload --sig HUP [id or name]\n```\n\n#### 删除进程  [ del/delete ]\n\n```go\nsudo pmon2 del [id or name]\n```\n\n#### 查看详情  [ show/desc ]\n\n```go\nsudo pmon2 show [id or name]\n```\n![](https://jscssimg-img.oss-cn-beijing.aliyuncs.com/89c3f649a583a852.png?t=1506950494)\n\n## 常见问题\n\n### 1.日志切割？\n\npmon2 自带一个 `logrotate` 日志切割配置文件，会默认切割 `/var/log/pmon2` 目录下的日志文件，如果你是自定义日志路径，请自行实现日志切割。\n\n### 2.进程启动参数必须传绝对路径？\n\n启动进程是，如果你传递的参数中存在路径，请使用绝对路径，`pmon2` 启动进程会新起一个新的沙盒环境以避免环境变量污染问题。\n\n### 3. 平台支持\n\n目前 `rpm` 适配 `CentOS6` 、 `CentOS7`、`CentOS8`， `Pmon2` 本身可运行在任何 `linux` 环境下，如有其它平台打包需求，请联系我们。\n\n### 4. 命令行自动补全\n\npmon2 提供 bash 自动补全脚本，如果你发觉在 `sudo` 模式下命令无法自动补全，请安装 `bash-completion`，退出终端重新进入即可：\n\n```bash\nsudo yum intsall -y bash-completion\n```\n\n### 5. FATA stat /var/run/pmon2/pmon2.sock: no such file or directory\n\n如果遇到如上报错，请尝试运行：\n\n```bash\n# centos6 使用 initctl\nsudo initctl start pmon2\n\n# centos7 使用 systemd\nsudo systemctl start pmon2\n```\n\n原因请参考，安装启动部分说明。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntt360%2Fpmon2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntt360%2Fpmon2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntt360%2Fpmon2/lists"}