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/redmine: fix permissions & cleanup #56243

Merged
merged 1 commit into from Mar 4, 2019
Merged

Conversation

aanderse
Copy link
Member

Motivation for this change

#53852

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@aanderse
Copy link
Member Author

aanderse commented Feb 25, 2019

@GrahamcOfBorg test redmine.redmine_3 redmine.redmine_4

@aanderse aanderse changed the title nixos/redmine: fix permissions & cleanup (for 19.09) nixos/redmine: fix permissions & cleanup Feb 25, 2019
@aanderse
Copy link
Member Author

aanderse commented Mar 2, 2019

@flokli feel like merging? On top of standard nixos tests I briefly ran this code in my organizations dev environment with no issues.

ln -fs "${cfg.stateDir}/public/$i" /run/redmine/public/
done

mkdir -m 0750 -p \
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we create these directories through systemd.tmpfiles.rules too?

Copy link
Member Author

@aanderse aanderse Mar 2, 2019

Choose a reason for hiding this comment

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

@flokli No need. The root has already been created with appropriate permission so the preStart script is free to operate here.

Do you have a style preference that says use tmpfiles.d over bash?

Copy link
Contributor

Choose a reason for hiding this comment

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

I do prefer declaring expected directory structure in systemd notation instead of shell scripts setting it up (so [StateDirectory=, CacheDirectory=, LogsDirectory=, and ConfigurationDirectory= over] tmpfiles.d over bash) - but that's more personal preference than general consensus.

Looking deeper into the setup script, do we really need to set all this up at each start, or can't we pre-build parts of the structure through nix?

Copy link
Member Author

Choose a reason for hiding this comment

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

@flokli That makes sense. I'll rework this to use tmpfiles.d and get back to you.

Copy link
Member Author

Choose a reason for hiding this comment

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

@flokli I think this should be good enough. Look alright to you?

@aanderse
Copy link
Member Author

aanderse commented Mar 3, 2019

@GrahamcOfBorg test redmine.redmine_3 redmine.redmine_4

Copy link
Contributor

@flokli flokli left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@infinisil infinisil merged commit 8f33ad7 into NixOS:master Mar 4, 2019
@aanderse aanderse deleted the redmine branch March 4, 2019 21:08
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

4 participants