Skip to content

upgrade, provision: keep /etc/speakerguardd readable for the seat user - #186

Merged
RyanTheTide merged 1 commit into
aurora-silicon:v2from
m0d16l14n1:j815/etc-dir-mode
Nov 17, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:v2from
m0d16l14n1:j815/etc-dir-mode

Conversation

@m0d16l14n1

Copy link
Copy Markdown
Contributor

After a successful switch to v2, the speakers are silent on every following boot. The cause is /etc/speakerguardd ending up 0700, which hides speakerguardd.conf from the seat user's session. Provisioning, the self-check and the supervisor all pass, but no speaker graph is ever linked.

What happens

  1. aurora-speaker-upgrade runs with umask 077. The switch writes /etc/speakerguardd/provision.conf before v2 has provisioned, so write_file()'s os.makedirs() creates /etc/speakerguardd as 0700.
  2. systemd's ConfigurationDirectoryMode=0755 doesn't change an existing directory. It only warns:
    speakerguardd-v2-provision.service: ConfigurationDirectory 'speakerguardd' already exists but the mode is different. (File system: 700 ConfigurationDirectoryMode: 755)
  3. ensure_dir() in speakerguardd-provision returns early for an existing directory, so nothing repairs it.
  4. graph-user runs as the seat user, and read_kv(/etc/speakerguardd/speakerguardd.conf) comes back empty:
    speakerguardd-provision: uid 1000 is not the seat user (none provisioned): no speaker graph here
    That happens even though provisioning had just bound that user (provisioned j815: blob … seat user nikita (seat0)). PipeWire gets no protected speaker sink, so there's no sound at all.

This is the same class of bug as RC8 E2E B4 (/run/speakerguardd-graph made 0700 under the tool's umask), on the one path that fix didn't cover.

Seen on a MacBook Air 15-inch M5 (J815, AID43 tuning from macOS 26B131, speakerguardd-v2 1.0.0alpha.1-40, aurora-speaker-upgrade 0.1-0.14). The switch passed (check rc 0, switch rc 0), and the next boot was silent.

Change

  • upgrade: make_parents() creates the missing parents of a file written outside the store at 0755, whatever the umask. Directories that already exist, including the store at 0700, are left alone.
  • provision: ensure_dir() adds the bits it wants to an existing directory that lacks them, and never removes any. Installs that are already affected repair themselves on their next provisioning run, with no manual chmod.

Tests

  • ConfigDirPermissions.test_a_config_dir_made_by_the_switch_is_world_readable (upgrade) and Umask.test_an_unreadable_config_dir_is_repaired (provision). Both fail on 04169c4 and pass with this change.
  • packaging/upgrade/tests: 38 passed.
  • packaging/session: 219 passed, 1 skipped. One failure, test_session.py::Idle::test_the_report_carries_play, is unrelated: it reads /proc/self/stat, which doesn't exist on the macOS host I ran it on.

@RyanTheTide could you take a look?

Assisted-by: Claude Opus 5.5

aurora-speaker-upgrade runs with umask 077. Its switch writes
/etc/speakerguardd/provision.conf before v2 has provisioned, so
write_file()'s makedirs() created /etc/speakerguardd 0700. systemd's
ConfigurationDirectoryMode=0755 only warns about an existing directory
("already exists but the mode is different"), and provisioning's
ensure_dir() returned early for it. From then on, the seat user's session
could not read speakerguardd.conf: speakerguardd-provision graph-user found
no SGV2_UID ("uid 1000 is not the seat user (none provisioned)"), linked
no speaker graph, and PipeWire had no protected speaker sink. The J815 was
silent on every boot after the switch, though provisioning, the self-check
and the supervisor all passed.

- upgrade: create the missing parents of a file written outside the store
  at 0755, whatever the umask. Existing directories are left alone.
- provision: ensure_dir() adds the bits it wants to an existing directory
  that lacks them, which repairs installs that are already affected on
  their next boot. It never removes bits.

Same class of bug as RC8 E2E B4 (/run/speakerguardd-graph), on the one
path that fix did not cover. Tests for both sides.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
@RyanTheTide
RyanTheTide merged commit bbd9ed3 into aurora-silicon:v2 Nov 17, 2026
6 checks passed
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.

2 participants