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
nginx: add custom options #48875
nginx: add custom options #48875
Conversation
''; | ||
description = " | ||
Shell commands executed before the service's nginx is started. | ||
"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the motivation for that? Can you provide an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example script-pre-nginx-start, generated with systemd.services.nginx.preStart
mkdir -p /var/spool/logs
chmod 700 /var/spool
chown -R web:web /var/spool
/nix/store/zg5sc4sby91mp4xvd29s9f1i7yc67va3-nginx-1.14.0/bin/nginx -c /nix/store/vjlj3ak74wb0vpavgwr911a40aqhcc63-nginx.conf -p /var/data/web/12000/spool -t
chown web:web /var/data/web
Command "chown web:web /var/data/web" not worked - error - Operation not permitted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the preStart
option help you here? You would still run into the same permission problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no problems in this case. Normal worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything above the command
/nix/store/zg5sc4sby91mp4xvd29s9f1i7yc67va3-nginx-1.14.0/bin/nginx
normal worked.
}; | ||
|
||
daemon = mkOption { | ||
default = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it started in deamon mode does the systemd service not need to change to forking too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated PR.
5586ef5
to
45c27f7
Compare
type = types.bool; | ||
description = " | ||
Determines whether nginx should become a daemon. Mainly used | ||
during development. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly used during development
Can you elaborate on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
45c27f7
to
af8ae49
Compare
Updated PR, daemon mode not worked. |
@GrahamcOfBorg test nginx |
Success on aarch64-linux (full log) Attempted: tests.nginx Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: tests.nginx Partial log (click to expand)
|
Thanks! |
Motivation for this change
Add custom options:
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)