Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/gdm: Fix pulseaudio tmpfiles structure #80274

Merged
merged 2 commits into from Feb 23, 2020

Conversation

tobim
Copy link
Contributor

@tobim tobim commented Feb 16, 2020

Fix the following startup failure of the sound service in the gdm
session that was introduced by #75893:

Feb 16 11:44:15 qp pulseaudio[1432]: W: [pulseaudio] core-util.c: Failed to open configuration file '/run/gdm/.config/pulse//daemon.conf': Not a directory
Feb 16 11:44:15 qp pulseaudio[1432]: W: [pulseaudio] daemon-conf.c: Failed to open configuration file: Not a directory
Feb 16 11:44:15 qp systemd[1380]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Feb 16 11:44:15 qp systemd[1380]: pulseaudio.service: Failed with result 'exit-code'.
Feb 16 11:44:15 qp systemd[1380]: Failed to start Sound Service.
Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Fix the following startup failure of the sound service in the gdm
session that was introduced by NixOS#75893:
```
Feb 16 11:44:15 qp pulseaudio[1432]: W: [pulseaudio] core-util.c: Failed to open configuration file '/run/gdm/.config/pulse//daemon.conf': Not a directory
Feb 16 11:44:15 qp pulseaudio[1432]: W: [pulseaudio] daemon-conf.c: Failed to open configuration file: Not a directory
Feb 16 11:44:15 qp systemd[1380]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Feb 16 11:44:15 qp systemd[1380]: pulseaudio.service: Failed with result 'exit-code'.
Feb 16 11:44:15 qp systemd[1380]: Failed to start Sound Service.
```
@@ -168,7 +168,8 @@ in
systemd.tmpfiles.rules = [
"d /run/gdm/.config 0711 gdm gdm -"
] ++ optionals config.hardware.pulseaudio.enable [
"L+ /run/gdm/.config/pulse - - - - ${pulseConfig}"
"d /run/gdm/.config/pulse 0711 gdm gdm"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is different than "d /run/gdm/.config 0711 gdm gdm -"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omitting the age filed has the same effect as - according to the man page.
Or are you referring to something else?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@worldofpeace worldofpeace added the 9.needs: port to stable A PR needs a backport to the stable release. label Feb 16, 2020
... by removing an unneeded explicit `-` for the directory age field where this parameter is already the default.

Co-Authored-By: worldofpeace <worldofpeace@protonmail.ch>
@worldofpeace
Copy link
Contributor

Made a clean vm and looked for the file

[root@nixos:/run/gdm/.config/pulse]# ll
total 20
-rw------- 1 gdm  gdm  108 Feb 23 12:22 8169178e55f3457b8553dd899e413214-card-database.x86_64-pc-linux-gnu.simple
-rw------- 1 gdm  gdm    1 Feb 23 12:22 8169178e55f3457b8553dd899e413214-default-sink
-rw------- 1 gdm  gdm    1 Feb 23 12:22 8169178e55f3457b8553dd899e413214-default-source
-rw------- 1 gdm  gdm  459 Feb 23 12:22 8169178e55f3457b8553dd899e413214-device-volumes.x86_64-pc-linux-gnu.simple
-rw------- 1 gdm  gdm  256 Feb 23 12:22 cookie
lrwxrwxrwx 1 root root  54 Feb 23 12:22 default.pa -> /nix/store/df6p9q81pjrv73ijq7yzvprmp2xpiggi-default.pa

@worldofpeace worldofpeace merged commit 44a4a38 into NixOS:master Feb 23, 2020
worldofpeace pushed a commit that referenced this pull request Feb 23, 2020
* nixos/gdm: Fix pulseaudio tmpfiles structure

Fix the following startup failure of the sound service in the gdm
session that was introduced by #75893:
```
Feb 16 11:44:15 qp pulseaudio[1432]: W: [pulseaudio] core-util.c: Failed to open configuration file '/run/gdm/.config/pulse//daemon.conf': Not a directory
Feb 16 11:44:15 qp pulseaudio[1432]: W: [pulseaudio] daemon-conf.c: Failed to open configuration file: Not a directory
Feb 16 11:44:15 qp systemd[1380]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Feb 16 11:44:15 qp systemd[1380]: pulseaudio.service: Failed with result 'exit-code'.
Feb 16 11:44:15 qp systemd[1380]: Failed to start Sound Service.
```

Co-authored-by: worldofpeace <worldofpeace@protonmail.ch>
(cherry picked from commit 44a4a38)
@worldofpeace
Copy link
Contributor

backported to 20.03 in 7a15ea9

@tobim
Copy link
Contributor Author

tobim commented Feb 24, 2020

Thanks!

@mmahut
Copy link
Member

mmahut commented Feb 26, 2020

I'm getting the following on today's switch to unstable, probably related?

Failed to open directory 'pulse': Not a directory
symlink(/nix/store/df6p9q81pjrv73ijq7yzvprmp2xpiggi-default.pa, /run/gdm/.config/pulse/default.pa) failed: Not a directory
warning: error(s) occurred while switching to the new configuration```

@tobim
Copy link
Contributor Author

tobim commented Feb 26, 2020

Did you get that message from the gdm session after boot or during nixos-rebuild?

@mmahut
Copy link
Member

mmahut commented Feb 26, 2020

During nixos-rebuild, the switch did not happen as it failed.

@tobim
Copy link
Contributor Author

tobim commented Feb 26, 2020

This is probably because of the switch causing the tmpfiles rules to be re-applied. On your running system the path /run/gdm/.config/pulse is a symlink pointing to the generated default.pa, so the command

 "d /run/gdm/.config/pulse 0711 gdm gdm" 

fails.

The workaround is to use nixos-rebuild boot this time around instead.

@tobim
Copy link
Contributor Author

tobim commented Feb 26, 2020

Or, if you can't reboot: Just delete the symlink manually.

@tobim tobim deleted the nixos/gdm-tmpfiles branch February 26, 2020 16:46
@worldofpeace
Copy link
Contributor

Yeah, /run isn't going to stick. This would only be an issue for unstable users. 19.09 -> 20.03 should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants