[20211115]配置logrotate提示parent directory has insecure permissions.txt

lfree發表於2021-11-15

[20211115]配置logrotate提示parent directory has insecure permissions.txt

--//今天在配置logrotate遇到一些問題,做一個記錄。

# /usr/sbin/logrotate -d  /etc/logrotate.d/oracle

rotating pattern: /u01/app/oracle/product/11.2.0.3/db_1/network/log/listener.log  weekly (5 rotations)
empty log files are not rotated, old logs are removed
considering log /u01/app/oracle/product/11.2.0.3/db_1/network/log/listener.log

error: skipping "/u01/app/oracle/product/11.2.0.3/db_1/network/log/listener.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.

--//我開始以為是某個目錄許可權問題,上網查詢,加入如下內容,問題解決。
su oracle oinstall
--//也可以加入如下。
su root root

--//我在想如何順序查詢目錄的許可權呢?簡單寫一行命令如下:

# cd / ;echo  /u01/app/oracle/product/11.2.0.3/db_1/network/log | sed 's+/+\n+g' | xargs -IQ echo   "ls -ld Q;cd Q" | bash
drwxr-xr-x. 4 root root 31 Feb  3  2021 u01
drwxr-xr-x. 5 root root 51 Aug 17 16:56 app
drwxrwxr-x. 10 oracle oinstall 143 May 19 09:02 oracle
drwxr-xr-x. 4 oracle oinstall 36 May 17 18:15 product
drwxr-xr-x. 3 oracle oinstall 18 May 17 18:15 11.2.0.3
drwxr-xr-x. 73 oracle oinstall 4096 Nov  2 09:37 db_1
drwxr-xr-x. 11 oracle oinstall 117 May 17 18:23 network
drwxrwx---. 2 oracle oinstall 26 Nov 15 08:47 log

--//這樣就可以順序看到各個目錄的許可權。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2842141/,如需轉載,請註明出處,否則將追究法律責任。

相關文章