[MDEV-7247] service mysql status not availabe in standard user Created: 2014-12-02 Updated: 2020-05-19 Resolved: 2020-05-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Platform Debian, Scripts & Clients |
| Affects Version/s: | 10.0 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Aurélien LEQUOY | Assignee: | Axel Schwenke |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Environment: |
ubuntu 12.04 |
||
| Issue Links: |
|
||||||||
| Description |
|
with standard user we coudln't run : service mysql status (work only in root) maybe is not a bug and you would this comportment but it's not standard. I made the fix, just tell me how to procede. |
| Comments |
| Comment by Barthelemy Vessemont [ 2014-12-02 ] | |||||||||||||||||||||||||||||||||||
|
+1
It's ok with any sudoer/root account :
| |||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-12-02 ] | |||||||||||||||||||||||||||||||||||
|
You can attach your patch to this JIRA issue, or go through the process as described here: https://mariadb.com/kb/en/mariadb/community/contributing-code/ , whichever you prefer. | |||||||||||||||||||||||||||||||||||
| Comment by Barthelemy Vessemont [ 2014-12-03 ] | |||||||||||||||||||||||||||||||||||
|
Hi, In order to allow standard user to check service status we need 2 things :
| |||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-02-08 ] | |||||||||||||||||||||||||||||||||||
|
otto, Please consider the report/request. If it shouldn't be implemented according to Debian policies or on any other reason, please close as 'Won't fix' with the explanation why not. Thanks. | |||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2015-02-08 ] | |||||||||||||||||||||||||||||||||||
|
In official Debian/Ubuntu packages service status looks the same no matter if it is run as root or not:
But it is true that even there the chmod is 0660 and not 0644 which is the standard. The pid file is however not created by the init script or anything in packaging, but by the mysqld daemon itself. | |||||||||||||||||||||||||||||||||||
| Comment by Jean Weisbuch [ 2015-02-09 ] | |||||||||||||||||||||||||||||||||||
|
The fact that the file isnt created with the right permission is due to the fact that a "umask" value is set and is "substracted" from the CreateFlags (permission for the new file(s) created). Adding "umask(0000);" before open() is called on the my_create function located on "mysys/my_create.c" makes the created pid file to have the right chmod (0664). | |||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2016-11-25 ] | |||||||||||||||||||||||||||||||||||
|
cvicentiu Can you do this {{"umask(0000);" before open() is called }} as suggested above if you think it makes sense? Current status for 10.2:
| |||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2020-05-19 ] | |||||||||||||||||||||||||||||||||||
|
This is a duplicate of https://jira.mariadb.org/browse/MDEV-5939. Both that and this should be closed, as the new systemd based service allows 'service mysql status' to work as expected for also non-root users. See longer explanation in https://jira.mariadb.org/browse/MDEV-5939 why I am closing this issue. |