nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.37k stars 323 forks source link

mkdir -p $runstatedir at run time, not install time (round 2) #1235

Closed alejandro-colomar closed 3 months ago

alejandro-colomar commented 5 months ago

Here are all the patches I prepared, in a single PR, tu allow you to understand the global idea I have in mind.

Feel free to apply this branch, or apply refactoring patches separately.

Cc: @ac000 , @andypost, @lcrilly , @thresheek

Supersedes: https://github.com/nginx/unit/pull/1227 Closes: https://github.com/nginx/unit/issues/742

thresheek commented 3 months ago

In that case can we add your

Acked-by: Konstantin Pavlov <thresh@nginx.com>

Sure!

ac000 commented 3 months ago

In that case can we add your

Acked-by: Konstantin Pavlov <thresh@nginx.com>

Sure!

Cheers!

@alejandro-colomar

Do you want to the do honours and rebase to master?

alejandro-colomar commented 3 months ago

In that case can we add your

Acked-by: Konstantin Pavlov <thresh@nginx.com>

Sure!

Cheers!

@alejandro-colomar

Do you want to the do honours and rebase to master?

Sure! :-)

v2g - Rebase - Acked-by: @thresheek ``` $ git range-diff master..gh/fs ngx/master..fs 1: 4af5714d = 1: 3db000a5 fs: Rename nxt_fs_mkdir_parent() => nxt_fs_mkdir_dirname() 2: b9164b1b = 2: 40eaf4e4 fs: Rename nxt_fs_mkdir_all() => nxt_fs_mkdir_p() 3: 76547576 = 3: af6a67ff fs: Use branchless code in nxt_fs_mkdir_p() 4: 30d86ba3 = 4: 2eb2f60b fs: Use a temporary variable in nxt_fs_mkdir_p() 5: 5bad130b = 5: c6ce0381 fs: Accept relative paths in nxt_fs_mkdir_p() 6: 7f66687a = 6: 3873f98f fs: Accept path names of length 1 in nxt_fs_mkdir_p() 7: c10f572f = 7: 7b7b303a fs: Invert logic to reduce indentation in nxt_fs_mkdir_dirname() 8: 73166a92 = 8: a9aed204 fs: Correctly handle "/" in nxt_fs_mkdir_dirname() 9: cdde66f7 ! 9: eca38349 fs: Make the full directory path for the pid file and the control socket @@ Commit message Tested-by: Andy Postnikov Tested-by: Andrew Clayton Reviewed-by: Andrew Clayton + Acked-by: Konstantin Pavlov Cc: Liam Crilly - Cc: Konstantin Pavlov Signed-off-by: Alejandro Colomar ## src/nxt_controller.c ## 10: 9ff0ba82 = 10: 2e2e5d1e auto: Don't install $runstatedir 11: 79b777c1 = 11: d96d5833 Use octal instead of mode macros ```
alejandro-colomar commented 3 months ago

You're welcome Andrew!