Summary: | koha-plack should check and fix log files permissions | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Command-line Utilities | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | barton, f.demians, julian.maurice, kyle, mirko, robin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16138 | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 16974: Make koha-plack should check and fix log files permissions
Bug 16974: Make koha-plack should check and fix log files permissions Bug 16974: Make koha-plack should check and fix log files permissions |
Description
Tomás Cohen Arazi (tcohen)
2016-07-25 18:07:17 UTC
Created attachment 53714 [details] [review] Bug 16974: Make koha-plack should check and fix log files permissions This patch adds a function to the koha-plack script so it checks for log file existence and its permissions. This function is called from the start_plack function. If some of this conditions are not fulfilled, it solves the situation by either touching and/or changing the permissions accordingly for the instances' plack log files. To test: - Run (on kohadevbox): $ cd kohaclone $ debian/scripts/koha-plack --start kohadev $ debian/scripts/koha-plack --stop kohadev $ ls /var/log/koha/kohadev/plack* - Verify ownership of the created files (they might belong to the root user) - Apply the patch - Run: $ chown root:root /var/log/koha/kohadev/plack* $ debian/scripts/koha-plack --start kohadev $ ls /var/log/koha/kohadev/plack* => SUCCESS: Files belong to kohadev-koha:kohadev-koha - Run: $ debian/scripts/koha-plack --stop kohadev $ rm /var/log/koha/kohadev/plack* $ debian/scripts/koha-plack --start kohadev $ ls /var/log/koha/kohadev/plack* => SUCCESS: Files are created and belong to kohadev-koha:kohadev-koha - Sign off :-D Created attachment 54319 [details] [review] Bug 16974: Make koha-plack should check and fix log files permissions This patch adds a function to the koha-plack script so it checks for log file existence and its permissions. This function is called from the start_plack function. If some of this conditions are not fulfilled, it solves the situation by either touching and/or changing the permissions accordingly for the instances' plack log files. To test: - Run (on kohadevbox): $ cd kohaclone $ debian/scripts/koha-plack --start kohadev $ debian/scripts/koha-plack --stop kohadev $ ls /var/log/koha/kohadev/plack* - Verify ownership of the created files (they might belong to the root user) - Apply the patch - Run: $ chown root:root /var/log/koha/kohadev/plack* $ debian/scripts/koha-plack --start kohadev $ ls /var/log/koha/kohadev/plack* => SUCCESS: Files belong to kohadev-koha:kohadev-koha - Run: $ debian/scripts/koha-plack --stop kohadev $ rm /var/log/koha/kohadev/plack* $ debian/scripts/koha-plack --start kohadev $ ls /var/log/koha/kohadev/plack* => SUCCESS: Files are created and belong to kohadev-koha:kohadev-koha - Sign off :-D Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> It did not work from within koha-shell. Since I don't think it would be called from within koha-shell, I assume it is supposed to be like that. Just wanted to leave a note in case it isn't. Created attachment 54374 [details] [review] Bug 16974: Make koha-plack should check and fix log files permissions This patch adds a function to the koha-plack script so it checks for log file existence and its permissions. This function is called from the start_plack function. If some of this conditions are not fulfilled, it solves the situation by either touching and/or changing the permissions accordingly for the instances' plack log files. To test: - Run (on kohadevbox): $ cd kohaclone $ debian/scripts/koha-plack --start kohadev $ debian/scripts/koha-plack --stop kohadev $ ls /var/log/koha/kohadev/plack* - Verify ownership of the created files (they might belong to the root user) - Apply the patch - Run: $ chown root:root /var/log/koha/kohadev/plack* $ debian/scripts/koha-plack --start kohadev $ ls /var/log/koha/kohadev/plack* => SUCCESS: Files belong to kohadev-koha:kohadev-koha - Run: $ debian/scripts/koha-plack --stop kohadev $ rm /var/log/koha/kohadev/plack* $ debian/scripts/koha-plack --start kohadev $ ls /var/log/koha/kohadev/plack* => SUCCESS: Files are created and belong to kohadev-koha:kohadev-koha - Sign off :-D Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for 16.11, thanks Tomas! Pushed in 16.05. Will be in 16.05.03. Pushed to 3.22.x, will be in 3.22.10 |