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

plex: fix startup issue #25128

Merged
merged 1 commit into from Apr 28, 2017
Merged

plex: fix startup issue #25128

merged 1 commit into from Apr 28, 2017

Conversation

jb55
Copy link
Contributor

@jb55 jb55 commented Apr 22, 2017

Fixes an issue with plex on startup

Fixes #24090

patch by: @dtzWill

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@jb55, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Forkk, @thoughtpolice and @jerith666 to be potential reviewers.

@@ -91,7 +91,7 @@ in
# Copy the database skeleton files to /var/lib/plex/.skeleton
# See the the Nix expression for Plex's package for more information on
# why this is done.
test -d "${cfg.dataDir}/.skeleton" || mkdir "${cfg.dataDir}/.skeleton"
test -d "${cfg.dataDir}/.skeleton" || (mkdir "${cfg.dataDir}/.skeleton" && chown ${cfg.user}:${cfg.group} "${cfg.dataDir}/.skeleton")
Copy link
Member

@Mic92 Mic92 Apr 23, 2017

Choose a reason for hiding this comment

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

The whole expression can be replaced by a single:

install --owner ${cfg.user} --group ${cfg.group} -d "${cfg.dataDir}/.skeleton"

Copy link
Member

Choose a reason for hiding this comment

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

I think the 'install' version will reset owner/group on the ".skeleton" directory should they be changed after creation. Similar to running the chown part of the command unconditionally.

I don't remember the details of how this is used but I seem to recall not changing permissions of existing directory might be important? Dunno.

Fixes an issue with plex on startup

Fixes NixOS#24090
@jb55
Copy link
Contributor Author

jb55 commented Apr 23, 2017 via email

@jb55
Copy link
Contributor Author

jb55 commented Apr 23, 2017 via email

@dtzWill
Copy link
Member

dtzWill commented Apr 23, 2017

Same, but that only happened by running the old version of this commit.

Anyway I thought for some reason preserving existing permissions might be useful for some reason, but nevermind :).

@joachifm joachifm merged commit 38c98d1 into NixOS:master Apr 28, 2017
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.

None yet

5 participants