Skip to content

Apply RemoveIPC=no at once, and report it only once it is in effect - #121

Merged
jgfoster merged 1 commit into
mainfrom
james/removeipc-live
Oct 13, 2026
Merged

jgfoster merged 1 commit into
mainfrom
james/removeipc-live

Conversation

@jgfoster

Copy link
Copy Markdown
Member

Why

On Linux, clicking the Survives logout row ran setRemoveIPC.sh, which wrote RemoveIPC=no to logind's config and stopped there. The row checked that file, so it disappeared straight away. But logind still had the old setting loaded, and it uses the loaded value when a user's last session ends. So the next logout destroyed the database's shared memory even though the sidebar said the problem was fixed. The success message did mention a restart, but the row going away said otherwise.

What

  • setRemoveIPC.sh applies the change. After writing the file it sends logind a reload signal (SIGHUP), which makes it re-read its config without restarting. Then it waits for logind's live RemoveIPC value to change. unset-os-config.sh reloads the same way when it removes the file.
  • The row reads the live value. It asks logind for its RemoveIPC D-Bus property with busctl, which any user can do. If busctl or logind can't answer, it falls back to reading the config files, as before.
  • A third state. If the file is written but logind hasn't loaded it, the row reads not yet applied instead of disappearing. After the script runs, the extension shows a warning for that case rather than a success message.
  • README.md and docs/automation-boundary.md are updated to match.

Worth checking

  • Older systemctl. The script calls systemctl kill --signal=SIGHUP without --kill-whom, because systemd 249's systemctl rejects that option. My first version used it and the reload silently never happened. logind runs as a single process, so leaving the option out makes no difference.
  • No systemd. On a Linux host without systemd (WSL without it, containers), busctl fails and the check falls back to the files. That's the same answer the row gave before this change.

Testing

Tested against real systemd in privileged Docker containers:

systemd 249 (Ubuntu 22.04) systemd 255 (Ubuntu 24.04)
Writing the file alone (old behaviour) still b true —
After the new script b false, "Config file reloaded", no logind restart b false, no logind restart
Ordinary user reading the property works —
A test user's shared-memory segment after logout survives after the script; destroyed under the default —
  • Added unit tests for combining the live value with the config files, and for parsing busctl's output.
  • npm test (762 passed), lint, format check and both typechecks pass.
  • Not run in the extension on a Linux desktop; the sidebar row and messages are covered only by unit tests.
  • Systemd versions older than 245 aren't covered. On those the script tells the user to restart, and the row reads not yet applied until they do.
  • CI's Linux job runs this script under sudo, so it will now reload logind on the runner too.

🤖 Generated with Claude Code

setRemoveIPC.sh wrote logind's config and stopped, and the "Survives
logout" row read that file, so the row vanished while the running logind
still had RemoveIPC=yes -- and logind reads the loaded value when a user's
last session ends, so the next logout killed the database anyway.

The script now sends logind SIGHUP, which re-reads its config without a
restart, and waits for the live value to change. The row reads logind's
RemoveIPC D-Bus property (any user may) and falls back to the files when
busctl or logind cannot answer; a file logind has not loaded shows as
"not yet applied" instead of hiding the row. unset-os-config.sh reloads
the same way.

Measured on systemd 249 (Ubuntu 22.04) and 255 (24.04) in containers:
writing the file alone leaves the property true; the script flips it with
no logind restart; a test user's shared-memory segment survives logout
after the script and is destroyed under the default. `--kill-whom` is not
used because systemd 249's systemctl does not know it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jgfoster
jgfoster added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit ba33aae Oct 13, 2026
5 checks passed
@jgfoster
jgfoster deleted the james/removeipc-live branch October 13, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant