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

Startx: Implement xserverArgs, improve logfile location #80272

Closed
wants to merge 7 commits into from

Conversation

Atemu
Copy link
Member

@Atemu Atemu commented Feb 16, 2020

Motivation for this change

Closes: #80198
The Xorg log was hard-coded to ~/.xorg.log, not ideal.

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.

@Atemu
Copy link
Member Author

Atemu commented Feb 16, 2020

@aszlig does this PR work for your setup which needed your change that I partially reverted?

@Atemu
Copy link
Member Author

Atemu commented Feb 18, 2020

Just telling users to set some option if they want to use startx as root was not a very good solution, so I somewhat hackily fixed the log location of xorg-server which understandably requires quite a rebuild and that probably isn't ideal.

I have a solution that would not require that rebuild and would work almost as well but isn't as clean; should I go with that instead?

Atemu added 7 commits May 7, 2020 19:53
Previously it'd try to use the one in its output path which is read-only of
course
Not sure why it was done this way. Now we can apply patches again
Xorg does this because X would crash if it couldn't write to the logfile.

Not a problem on NixOS as journald should create the dir automatically and the
logfile location is set to /dev/null for all displayManagers but startx.
It was in ${xorg.xorgserver}/var/log before which isn't writable and that would
crash X.

This required some workarounds for the startx displayManager which are no longer
needed now.
It makes sense for it to be /dev/null for all the displayManagers but startx,
it needs a different logFile configuration.
This partially reverts bf3d3dd.

I don't know why we weren't getting a default logfile back then but Xorg
definitely provides one now (see `man Xorg`). It's in a much better place
aswell ($XDG_DATA_HOME)
@Atemu
Copy link
Member Author

Atemu commented May 7, 2020

My previous patchset was clumsy, hacky and had some unecessary changes in it. What I just force-pushed should be a lot better.

@Atemu Atemu changed the title Startx: Implement xserverArgs, include default xinitrc dependencies, improve logging Startx: Implement xserverArgs, improve logfile location May 7, 2020
@Atemu
Copy link
Member Author

Atemu commented May 7, 2020

I successfully ran the i3-wm test and manually confirmed that sway and i3 work.

I did not have the time to build and test every package that depends on xorgserver.

@Atemu
Copy link
Member Author

Atemu commented Oct 3, 2020

/marvin opt-in
/status needs_reviewer

@marvin-mk2
Copy link

marvin-mk2 bot commented Oct 3, 2020

Hi! I'm an experimental bot. My goal is to guide this PR through its stages, hopefully ending with a merge. You can read up on the usage here.

@marvin-mk2
Copy link

marvin-mk2 bot commented Oct 8, 2020

Reminder: Please review!

This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the needs_reviewer queue in one day.

Comment on lines 762 to 764
prePatch = ''
sed -i 's|^defaultserverargs="|&-logfile \"$HOME/.xorg.log\"|p' startx.cpp
'';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be part of the commit were you patched xorg.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's one logical step: Old solution with hard-coded path in xinit -> new solution with upstream path and configurable override in NixOS that was set up in the previous commits.

pkgs/servers/x11/xorg/overrides.nix Show resolved Hide resolved
pkgs/servers/x11/xorg/overrides.nix Show resolved Hide resolved
pkgs/servers/x11/xorg/overrides.nix Show resolved Hide resolved
@marvin-mk2
Copy link

marvin-mk2 bot commented Oct 12, 2020

Reminder: Please review!

This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the needs_reviewer queue in one day.

@doronbehar
Copy link
Contributor

@timokau this PR was reviewed yet @marvin-mk2 still nags it to be reviewed.

@timokau
Copy link
Member

timokau commented Oct 12, 2020

@doronbehar I think you left your review as "comment" instead of "request changes", which left the status as "awaiting review". Its debatable if this is correct or not, but at least its not a bug. My intention is to avoid having PRs stuck in "awaiting changes" where they can be forgotten, so I err'ed on the side of "awaiting review".

/status awaiting_changes

@Atemu
Copy link
Member Author

Atemu commented Oct 16, 2020

Continued in #100774

@Atemu Atemu closed this Oct 16, 2020
@Atemu Atemu deleted the startx-imporvements branch August 11, 2021 20:55
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.

Startx displayManager doesn't pass xserverArgs to X
4 participants