Skip to content

Commit 1bafc6f

Browse files
committed
Correct the no-systemd setup statements in the package guide
Tested with the 1.0.1 packages on a host without systemd: re-running setup keeps a loopback bind, and a scoped restore stops only that major's recorded gateway. The 1.0 packages also depend on procps, so the minimal-RHEL known issue no longer applies. Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com>
1 parent 90cfa08 commit 1bafc6f

3 files changed

Lines changed: 28 additions & 21 deletions

File tree

‎PACKAGE-INSTALL.md‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,19 +313,18 @@ On a systemd host, a scoped restore stops and disables that major's gateway:
313313
sudo documentdb-setup --restore --pg-version 18
314314
```
315315

316-
On a host without systemd, the current setup tooling cannot safely attribute a nohup gateway process to one
317-
PostgreSQL major. If only one DocumentDB major is configured, use an unscoped restore so the
318-
orphan gateway sweep runs:
316+
On a host without systemd, the same scoped restore stops the gateway that setup started for
317+
that major and leaves other majors running. It skips a gateway it has no valid record of; if the
318+
port is still listening afterwards, find the process on it and stop it. Setup runs the gateway
319+
as `documentdb-gateway`, so `sudo -u documentdb-gateway ss -lntp` shows its PID even in a
320+
container where root's `ss` doesn't. An unscoped restore also stops nohup gateways started by
321+
the packaged binary's full path, but it detaches every configured major; re-run setup for the
322+
majors you are keeping:
319323

320324
```bash
321325
sudo documentdb-setup --restore --yes
322326
```
323327

324-
If more than one DocumentDB major is configured without systemd, schedule a maintenance window
325-
and use the same unscoped restore. It detaches every configured major and stops the nohup
326-
gateways; re-run setup for the majors you are keeping afterward. A scoped restore alone is not
327-
sufficient on a no-systemd host.
328-
329328
Restart the adopted PostgreSQL service after restore to apply removal of the managed settings.
330329
On an unscoped multi-major restore, restart each operator-managed PostgreSQL service involved.
331330

‎app/services/articleService.ts‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ The gateway binds **all interfaces** (\`0.0.0.0:10260\` and \`[::]:10260\`) by d
336336
337337
Before using this anywhere but a private machine:
338338
339-
- Restrict the listener with \`DOCUMENTDB_LISTEN_ADDR=127.0.0.1:10260\` in \`/etc/documentdb/local/<major>/gateway.env\` and restart the service, or firewall port \`10260\`. **Re-running \`documentdb-setup\` silently resets this to a wildcard bind**, so re-check with \`grep DOCUMENTDB_LISTEN_ADDR /etc/documentdb/local/<major>/gateway.env\` afterwards. A firewall rule is the more durable control.
339+
- Restrict the listener with \`DOCUMENTDB_LISTEN_ADDR=127.0.0.1:10260\` in \`/etc/documentdb/local/<major>/gateway.env\` and restart the service, or firewall port \`10260\`. Re-running \`documentdb-setup\` keeps a loopback address written this way, and prints \`Keeping gateway bind address\` when it does.
340340
- Use a strong admin password and create per-application users rather than sharing \`admin\`.
341341
342342
### Replace the self-signed certificate
@@ -544,19 +544,18 @@ On a systemd host, a scoped restore stops and disables that major's gateway:
544544
sudo documentdb-setup --restore --pg-version 18
545545
\`\`\`
546546
547-
On a host without systemd, the current setup tooling cannot safely attribute a nohup gateway process to one
548-
PostgreSQL major. If only one DocumentDB major is configured, use an unscoped restore so the
549-
orphan gateway sweep runs:
547+
On a host without systemd, the same scoped restore stops the gateway that setup started for
548+
that major and leaves other majors running. It skips a gateway it has no valid record of; if the
549+
port is still listening afterwards, find the process on it and stop it. Setup runs the gateway
550+
as \`documentdb-gateway\`, so \`sudo -u documentdb-gateway ss -lntp\` shows its PID even in a
551+
container where root's \`ss\` doesn't. An unscoped restore also stops nohup gateways started by
552+
the packaged binary's full path, but it detaches every configured major; re-run setup for the
553+
majors you are keeping:
550554
551555
\`\`\`bash
552556
sudo documentdb-setup --restore --yes
553557
\`\`\`
554558
555-
If more than one DocumentDB major is configured without systemd, schedule a maintenance window
556-
and use the same unscoped restore. It detaches every configured major and stops the nohup
557-
gateways; re-run setup for the majors you are keeping afterward. A scoped restore alone is not
558-
sufficient on a no-systemd host.
559-
560559
Restart the adopted PostgreSQL service after restore to apply removal of the managed settings.
561560
On an unscoped multi-major restore, restart each operator-managed PostgreSQL service involved.
562561
@@ -589,8 +588,7 @@ These are defects in this release, not expected behaviour. Most need a host with
589588
| --- | --- | --- |
590589
| Status | \`documentdb-setup --status\` can report "active" for any process holding port 10260 | **any host** |
591590
| Restart | Re-running \`documentdb-setup\` to restart can hang; redirecting output to a file avoids it | no systemd |
592-
| Stop | A scoped \`documentdb-setup --restore --pg-version N\` cannot stop a nohup gateway; follow the no-systemd brownfield removal steps above | no systemd |
593-
| Minimal RHEL | Install \`procps-ng\` first, or \`--restore\` reports success while the gateway keeps serving and a later run fails with \`Port 10260 is already in use\` | no systemd |
591+
| Stop | A scoped \`documentdb-setup --restore --pg-version N\` skips a nohup gateway it has no valid record of; follow the no-systemd brownfield removal steps above | no systemd |
594592
595593
**Prefer a systemd host for anything you care about**, where the service lifecycle is managed by systemd rather than by the setup script.
596594

‎tests/packageArticles.test.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,19 @@ describe('Linux package articles', () => {
257257
expect(linuxPackagesOperationsContent).toContain(
258258
'sudo documentdb-setup --restore --yes',
259259
);
260-
expect(linuxPackagesOperationsContent).toMatch(
261-
/A scoped restore alone is not\s+sufficient on a no-systemd host\./,
260+
// Both copies must state the same no-systemd behaviour, including the exception.
261+
const packageInstall = fs.readFileSync(
262+
fileURLToPath(new URL('../PACKAGE-INSTALL.md', import.meta.url)),
263+
'utf8',
264+
);
265+
const noSystemd = (text: string) =>
266+
text.match(/On a host without systemd, the same scoped restore[\s\S]*?majors you are keeping:/)?.[0]
267+
.replace(/\s+/g, ' ');
268+
expect(noSystemd(linuxPackagesOperationsContent)).toMatch(
269+
/the same scoped restore stops the gateway that setup started for that major and leaves other majors running/,
262270
);
271+
expect(noSystemd(linuxPackagesOperationsContent)).toMatch(/skips a gateway it has no valid record of/);
272+
expect(noSystemd(packageInstall)).toBe(noSystemd(linuxPackagesOperationsContent));
263273
expect(linuxPackagesOperationsContent).toContain(
264274
'Restart the adopted PostgreSQL service after restore',
265275
);

0 commit comments

Comments
 (0)