Comments (8)
it makes perfectly sense! let's fix that!
from log_proxy.
note: the option to change ownership can work only for the root user
from log_proxy.
I have an implementation with this new option:
-c, --chmod if set, chmod the logfile to this octal value (0700 for example)
@tomalok it would be ok for you?
from log_proxy.
While an explicit --chmod
is welcome, it doesn't address/solve the ownership issue (in my case, root:docker
; FWIW, I haven't take a close look at the PR yet so I don't know offhand if a solution is in there).
I think an implicit solution might be a little easier to do... That is, when logs are rotated, log_proxy
would stat
the old log file and then TRY to chmod
and chown
the new log file to be the same. If the user that log_proxy
is running as does not have sufficient privileges to set either the mode or the ownership (i.e. the chmod
or chown
fails) that's okay, and move along (maybe emit a warning somewhere).
from log_proxy.
Yes, the PR is only a beginning about permissions.
I don't like the implicit solution because the final result depends on original state. IMHO, it would be perfectly ok for a stateful thing like a database. But here with logs, I don't like the fact that if you clean your log directory (which sounds ok at any time), you will get some different results about permissions and ownership.
So i'm going to introduce a "best effort" explicit chown option.
from log_proxy.
new options introduced in the PR:
+ { "chmod", 'c', 0, G_OPTION_ARG_STRING, &chmod_str, "if set, chmod the logfile to this octal value (0700 for example)", NULL },
+ { "chown", 'o', 0, G_OPTION_ARG_STRING, &chown_str, "if set, try (if you don't have sufficient privileges, it will fail silently) to change the owner of the logfile to the given user value", NULL },
+ { "chgrp", 'g', 0, G_OPTION_ARG_STRING, &chgrp_str, "if set, try (if you don't have sufficient privileges, it will fail silently) to change the group of the logfile to the given group value", NULL }
@tomalok: ok for your use-case ?
from log_proxy.
@thefab that should do the trick for me.
from log_proxy.
@tomalok 0.4 is out ;-)
from log_proxy.
Related Issues (15)
- introduce a log directory HOT 4
- Unable to link binaries... HOT 3
- wrapper makes fifo in /tmp HOT 5
- binaries are small, dependencies are not HOT 4
- Are two separate binaries necessary? HOT 1
- log_proxy_wrapper fails with -O, -E, and -F, missing new options. HOT 3
- add an option to force the rotation at startup
- Rotate files at fixed points in time HOT 1
- malloc inside signal handler
- control file names should be prefixed by "." (dot) HOT 1
- Handling of double-quotes in command-line arguments of log_proxy_wrapper
- large memory usage for some log_proxy instances HOT 3
- problem when a maximum file size if set by ulimit HOT 2
- GTimeVal and g_get_current_time are deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log_proxy.