Giter Club home page Giter Club logo

Comments (8)

thefab avatar thefab commented on June 24, 2024

it makes perfectly sense! let's fix that!

from log_proxy.

thefab avatar thefab commented on June 24, 2024

note: the option to change ownership can work only for the root user

from log_proxy.

thefab avatar thefab commented on June 24, 2024

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.

tomalok avatar tomalok commented on June 24, 2024

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.

thefab avatar thefab commented on June 24, 2024

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.

thefab avatar thefab commented on June 24, 2024

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.

tomalok avatar tomalok commented on June 24, 2024

@thefab that should do the trick for me.

from log_proxy.

thefab avatar thefab commented on June 24, 2024

@tomalok 0.4 is out ;-)

from log_proxy.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.