@the-seeker/server-agent 0.1.1 → 0.1.2
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/README.md +1 -1
- package/dist/install/systemd.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ capability: `available`=조회 성공, `unsupported`=OS 미지원 또는 nginx
|
|
|
86
86
|
|
|
87
87
|
## 문제 해결
|
|
88
88
|
|
|
89
|
-
systemd의 PATH에서 nvm으로 설치한 PM2가 보이지 않으면 capability가 `not_installed`가 될 수 있습니다. `@the-seeker/server-agent@0.1.1`부터는 실행 중인 node의 `dirname(process.execPath)/pm2`를 자동으로 찾고, `install`이 systemd unit에 `Environment=PATH=<node bin dir>:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`을 기록합니다. 업그레이드 후 호스트에서 `install`을 다시 실행하면
|
|
89
|
+
systemd의 PATH에서 nvm으로 설치한 PM2가 보이지 않으면 capability가 `not_installed`가 될 수 있습니다. `@the-seeker/server-agent@0.1.1`부터는 실행 중인 node의 `dirname(process.execPath)/pm2`를 자동으로 찾고, `install`이 systemd unit에 `Environment=PATH=<node bin dir>:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`을 기록합니다. 업그레이드 후 호스트에서 `install`을 다시 실행하면 됩니다(0.1.1은 이어서 `sudo systemctl restart theseeker-agent` 필요, 0.1.2부터 `install`이 자동 재시작).
|
|
90
90
|
|
|
91
91
|
자동 설정을 쓰지 않을 때는 systemd drop-in으로 PM2 실행 파일을 지정합니다.
|
|
92
92
|
|
package/dist/install/systemd.js
CHANGED
|
@@ -54,6 +54,7 @@ export function manualInstallCommands(endpoint, user, addGroups) {
|
|
|
54
54
|
"and then runs:",
|
|
55
55
|
" sudo systemctl daemon-reload",
|
|
56
56
|
` sudo systemctl enable --now ${SERVICE_NAME}`,
|
|
57
|
+
` sudo systemctl restart ${SERVICE_NAME}`,
|
|
57
58
|
];
|
|
58
59
|
}
|
|
59
60
|
export function manualGroupCommand(user) {
|
|
@@ -89,6 +90,11 @@ export async function installSystemd(environment, options) {
|
|
|
89
90
|
if (!(await runSystemctl(environment, ["enable", "--now", SERVICE_NAME])))
|
|
90
91
|
return 1;
|
|
91
92
|
environment.print(`service enabled: ${SERVICE_NAME}`);
|
|
93
|
+
// `enable --now` no-ops on an already-running service, so an upgraded package or a rewritten unit/config
|
|
94
|
+
// would keep running the old process until someone restarted it by hand.
|
|
95
|
+
if (!(await runSystemctl(environment, ["restart", SERVICE_NAME])))
|
|
96
|
+
return 1;
|
|
97
|
+
environment.print(`service restarted: ${SERVICE_NAME}`);
|
|
92
98
|
if (!options.addGroups)
|
|
93
99
|
for (const line of manualGroupCommand(options.detection.user))
|
|
94
100
|
environment.print(line);
|