[MCOL-1184] non-root Log Rotation not working Created: 2018-01-29  Updated: 2018-02-07  Resolved: 2018-02-07

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.1.2
Fix Version/s: 1.1.3

Type: Bug Priority: Minor
Reporter: David Hill (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

amazon ami non-root install


Sprint: 2018-03

 Description   

ColumnStore logs should rotate to an archive directory every 24 hours. Its not working on non-root due to permissions errors.

logrotate -f columnstore
error: skipping "/var/log/mariadb/columnstore/alarm.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/mariadb/columnstore/crit.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/mariadb/columnstore/debug.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/mariadb/columnstore/err.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/mariadb/columnstore/info.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/mariadb/columnstore/uiCommands.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/mariadb/columnstore/warning.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/mariadb/columnstore/load_brm.log1" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/mariadb/columnstore/reset_locks.log1" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/mariadb/columnstore/save_brm.log1" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/home/mariadb-user/mariadb/columnstore/mysql/db/ip-172-30-0-6.err" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/home/mariadb-user/mariadb/columnstore/mysql/db/ip-172-30-0-6.us-west-2.compute.internal.err" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
[root@ip-172-30-0-6 logrotate.d]# pwd
/etc/logrotate.d
[root@ip-172-30-0-6 logrotate.d]#

ll
total 476
-rwxrwxrwx 1 syslog adm 9821 Jan 26 22:48 alarm.log
drwxrwxrwx 2 syslog adm 6 Jan 24 20:15 archive
drwxr-xr-x 2 syslog adm 6 Jan 24 20:15 corefiles
-rwxr-xr-x 1 mariadb-user mariadb-user 1848 Jan 26 22:36 crit.log
-rwxrwxrwx 1 syslog adm 398580 Jan 29 15:21 debug.log
-rwxr-xr-x 1 mariadb-user mariadb-user 3127 Jan 26 22:47 err.log
-rwxrwxrwx 1 syslog adm 40584 Jan 29 15:21 info.log
rw-rr- 1 mariadb-user mariadb-user 78 Jan 29 15:21 load_brm.log1
rw-rr- 1 mariadb-user mariadb-user 229 Jan 29 15:21 reset_locks.log1
rw-rr- 1 mariadb-user mariadb-user 81 Jan 26 22:47 save_brm.log1
drwxrwxrwx 2 syslog adm 15 Jan 26 21:32 trace
rw-rw-r- 1 mariadb-user mariadb-user 326 Jan 26 22:49 uiCommands.log
-rwxrwxrwx 1 syslog adm 4819 Jan 26 22:48 warning.log
[root@ip-172-30-0-6 columnstore]# cd ..
[root@ip-172-30-0-6 mariadb]# ll
total 4
drwxrwxrwx 5 syslog adm 4096 Jan 29 15:20 columnstore
[root@ip-172-30-0-6 mariadb]#



 Comments   
Comment by David Hill (Inactive) [ 2018-02-05 ]

fixed, can do the following for non-root verify.. can do the same for root install, just the owner will be root.

[mariadb-user@ip-172-30-0-73 bin]$ log
[mariadb-user@ip-172-30-0-73 columnstore]$ ll
total 56
rw-rr- 1 mariadb-user mariadb-user 0 Feb 5 20:24 activeAlarms
rw-rr- 1 mariadb-user mariadb-user 216 Feb 5 20:24 alarm.log
drwxrwxr-x 2 mariadb-user mariadb-user 6 Feb 5 20:23 archive
drwxr-xr-x 2 mariadb-user mariadb-user 6 Feb 5 20:23 corefiles
rw------ 1 syslog adm 41692 Feb 5 20:25 debug.log
rw------ 1 syslog adm 1459 Feb 5 20:25 info.log
rw-rw-r- 1 mariadb-user mariadb-user 594 Feb 5 20:25 mcsadmin.log
drwxrwxr-x 2 mariadb-user mariadb-user 15 Feb 5 20:25 trace

  1. logrotate -f /etc/logrotate.d/columnstore

[root@ip-172-30-0-73 columnstore]# ll
total 0
rw-rr- 1 mariadb-user mariadb-user 0 Feb 5 20:24 activeAlarms
rw-rr- 1 mariadb-user mariadb-user 0 Feb 5 20:26 alarm.log
drwxrwxr-x 2 mariadb-user mariadb-user 108 Feb 5 20:26 archive
drwxr-xr-x 2 mariadb-user mariadb-user 6 Feb 5 20:23 corefiles
rw------ 1 syslog adm 0 Feb 5 20:26 debug.log
rw------ 1 syslog adm 0 Feb 5 20:26 info.log
rw-rw-r- 1 mariadb-user mariadb-user 0 Feb 5 20:26 mcsadmin.log
drwxrwxr-x 2 mariadb-user mariadb-user 15 Feb 5 20:25 trace
[root@ip-172-30-0-73 columnstore]# ll archive/
total 56
rw-rr- 1 mariadb-user mariadb-user 216 Feb 5 20:26 alarm.log-20180205
rw------ 1 syslog adm 41692 Feb 5 20:26 debug.log-20180205
rw------ 1 syslog adm 1459 Feb 5 20:26 info.log-20180205
rw-rw-r- 1 mariadb-user mariadb-user 594 Feb 5 20:26 mcsadmin.log-20180205

Comment by David Hill (Inactive) [ 2018-02-05 ]

and there was 1 additional change. the mcsadmin command log was changed from UIcommands.log to mcsadmin.log

Comment by David Hill (Inactive) [ 2018-02-05 ]

here is a root install test

[root@ip-172-30-0-73 columnstore]# ll
total 56
rw-rr- 1 root root 0 Feb 5 20:33 activeAlarms
rw-rr- 1 root root 216 Feb 5 20:33 alarm.log
drwxr-xr-x 2 root root 6 Feb 5 20:32 archive
drwxr-xr-x 2 root root 6 Feb 5 20:32 corefiles
-rwxr-xr-x 1 syslog adm 41596 Feb 5 20:33 debug.log
-rwxr-xr-x 1 syslog adm 1459 Feb 5 20:33 info.log
rw-rr- 1 root root 772 Feb 5 20:34 mcsadmin.log
drwxr-xr-x 2 root root 15 Feb 5 20:33 trace
[root@ip-172-30-0-73 columnstore]# logrotate -f /etc/logrotate.d/columnstore
[root@ip-172-30-0-73 columnstore]# ll
total 0
rw-rr- 1 root root 0 Feb 5 20:33 activeAlarms
rw-rr- 1 root root 0 Feb 5 20:34 alarm.log
drwxr-xr-x 2 root root 108 Feb 5 20:34 archive
drwxr-xr-x 2 root root 6 Feb 5 20:32 corefiles
-rwxr-xr-x 1 syslog adm 0 Feb 5 20:34 debug.log
-rwxr-xr-x 1 syslog adm 0 Feb 5 20:34 info.log
rw-rr- 1 root root 0 Feb 5 20:34 mcsadmin.log
drwxr-xr-x 2 root root 15 Feb 5 20:33 trace
[root@ip-172-30-0-73 columnstore]# ll archive/
total 56
rw-rr- 1 root root 216 Feb 5 20:34 alarm.log-20180205
-rwxr-xr-x 1 syslog adm 41596 Feb 5 20:34 debug.log-20180205
-rwxr-xr-x 1 syslog adm 1459 Feb 5 20:34 info.log-20180205
rw-rr- 1 root root 772 Feb 5 20:34 mcsadmin.log-20180205

Comment by David Hill (Inactive) [ 2018-02-05 ]

https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/396

Comment by Ben Thompson (Inactive) [ 2018-02-05 ]

Reviewed / Merged

Comment by Daniel Lee (Inactive) [ 2018-02-07 ]

Build verified: 1.1.3-1 Github source
[root@localhost ~]# cat mariadb-columnstore-1.1.3-1-centos7.x86_64.bin.tar.gz.txt
/root/columnstore/mariadb-columnstore-server
commit e5499e513d88a3dfefbe9a356e20a1bceb1bde38
Merge: 99cdb0a 4840a43
Author: david hill <david.hill@mariadb.com>
Date: Wed Jan 31 16:53:52 2018 -0600
Merge pull request #92 from mariadb-corporation/MCOL-1152
MCOL-1152: Change the debian package names.
/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit ffcc4e94ccd07b6bbdfc47531c4c2f065f3fab47
Merge: 05431bf 3fb5dde
Author: benthompson15 <ben.thompson@mariadb.com>
Date: Mon Feb 5 22:37:05 2018 -0600
Merge pull request #398 from mariadb-corporation/statuscontrol-fix
add ProcStatusControl to postConfigure setup

Generated at Thu Feb 08 02:26:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.