@kenhkl/agent-moss 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +12 -12
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5731,18 +5731,18 @@ async function main() {
|
|
|
5731
5731
|
const binPath = which || `${process.execPath} ${path3.join(__dirname7, "cli.js")}`;
|
|
5732
5732
|
let content = fs4.readFileSync(srcPath, "utf-8");
|
|
5733
5733
|
content = content.replace("__AGENT_MOSS_BIN__", binPath);
|
|
5734
|
-
const dst = "/etc/systemd/system/
|
|
5734
|
+
const dst = "/etc/systemd/system/agent-moss.service";
|
|
5735
5735
|
fs4.writeFileSync(dst, content, "utf-8");
|
|
5736
5736
|
fs4.chmodSync(dst, 420);
|
|
5737
5737
|
console.log(`\u2705 \u5DF2\u5B89\u88C5 systemd service: ${dst}`);
|
|
5738
5738
|
execSync("systemctl daemon-reload", { stdio: "inherit" });
|
|
5739
5739
|
console.log("\u2705 systemctl daemon-reload \u5B8C\u6210");
|
|
5740
5740
|
if (enable) {
|
|
5741
|
-
execSync("systemctl enable
|
|
5742
|
-
console.log("\u2705 systemctl enable
|
|
5741
|
+
execSync("systemctl enable agent-moss", { stdio: "inherit" });
|
|
5742
|
+
console.log("\u2705 systemctl enable agent-moss \u5B8C\u6210");
|
|
5743
5743
|
}
|
|
5744
|
-
console.log("\n\u542F\u52A8\u670D\u52A1\uFF1A sudo systemctl start
|
|
5745
|
-
console.log("\u67E5\u770B\u72B6\u6001\uFF1A sudo systemctl status
|
|
5744
|
+
console.log("\n\u542F\u52A8\u670D\u52A1\uFF1A sudo systemctl start agent-moss");
|
|
5745
|
+
console.log("\u67E5\u770B\u72B6\u6001\uFF1A sudo systemctl status agent-moss");
|
|
5746
5746
|
console.log("\u67E5\u770B\u65E5\u5FD7\uFF1A journalctl -u agent_moss -f");
|
|
5747
5747
|
break;
|
|
5748
5748
|
}
|
|
@@ -5751,9 +5751,9 @@ async function main() {
|
|
|
5751
5751
|
const { execSync } = await import("child_process");
|
|
5752
5752
|
let systemdInfo = "";
|
|
5753
5753
|
try {
|
|
5754
|
-
const out = execSync("systemctl is-active
|
|
5754
|
+
const out = execSync("systemctl is-active agent-moss 2>/dev/null || true", { encoding: "utf-8" }).trim();
|
|
5755
5755
|
if (out === "active") {
|
|
5756
|
-
const show = execSync("systemctl show
|
|
5756
|
+
const show = execSync("systemctl show agent-moss --property=MainPID,ActiveEnterTimestamp,ExecStart 2>/dev/null || true", { encoding: "utf-8" });
|
|
5757
5757
|
for (const line of show.trim().split("\n")) {
|
|
5758
5758
|
const [key, ...vals] = line.split("=");
|
|
5759
5759
|
const val = vals.join("=");
|
|
@@ -5831,10 +5831,10 @@ async function main() {
|
|
|
5831
5831
|
}
|
|
5832
5832
|
console.log();
|
|
5833
5833
|
console.log(" \u542F\u505C\u547D\u4EE4\uFF1A");
|
|
5834
|
-
console.log(" systemctl start
|
|
5835
|
-
console.log(" systemctl stop
|
|
5836
|
-
console.log(" systemctl restart
|
|
5837
|
-
console.log(" systemctl status
|
|
5834
|
+
console.log(" systemctl start agent-moss \u542F\u52A8");
|
|
5835
|
+
console.log(" systemctl stop agent-moss \u505C\u6B62");
|
|
5836
|
+
console.log(" systemctl restart agent-moss \u91CD\u542F");
|
|
5837
|
+
console.log(" systemctl status agent-moss \u72B6\u6001");
|
|
5838
5838
|
console.log(" journalctl -u agent_moss -f \u65E5\u5FD7");
|
|
5839
5839
|
} else {
|
|
5840
5840
|
console.log(`\u274C AgentMoss \u670D\u52A1\u672A\u8FD0\u884C`);
|
|
@@ -5843,7 +5843,7 @@ async function main() {
|
|
|
5843
5843
|
console.log(` \u68C0\u67E5\u65E5\u5FD7\uFF1Ajournalctl -u agent_moss -n 20 --no-pager`);
|
|
5844
5844
|
} else {
|
|
5845
5845
|
console.log(` \u542F\u52A8\u65B9\u5F0F\uFF1A`);
|
|
5846
|
-
console.log(` systemctl start
|
|
5846
|
+
console.log(` systemctl start agent-moss \uFF08systemd\uFF09`);
|
|
5847
5847
|
console.log(` agent-moss server \uFF08\u524D\u53F0\uFF09`);
|
|
5848
5848
|
}
|
|
5849
5849
|
process.exit(1);
|