Logrotate failing

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Logrotate failing

Post by baz123 »

Hi Folks,

logrotate is failing when a full log option has been selected.

Code: Select all

Feb 27 00:00:33 DietPi systemd[1]: Starting Rotate log files...
Feb 27 00:00:33 DietPi logrotate[1497]: error: skipping "/var/log/alternatives.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.

Code: Select all

root@DietPi:~# ls -la /var/
drwxrwxrwt  7 root root         360 Feb 27 01:22 log
I note the sticky bit is set (though I am unaware as to how or what that means!).
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Logrotate failing

Post by Joulinar »

hi,

the permission vor /var/log should be 755
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: Logrotate failing

Post by baz123 »

Joulinar wrote: Thu Feb 27, 2020 8:35 pm the permission vor /var/log should be 755
I haven't changed them.

Software installed is

Code: Select all

root@DietPi:/etc/cron.daily# dietpi-software list | grep " =2 "
id 0 | =2 | openssh client:  |
id 17 | =2 | git client: git clone etc |
id 65 | =2 | netdata: real-time performance monitoring | | https://dietpi.com/phpbb/viewtopic.php?p=1611#p1611
id 92 | =2 | certbot: free, ssl cert install allowing https:// | | https://dietpi.com/phpbb/viewtopic.php?p=1062#p1062
id 101 | =2 | log rotate: rotates log files | | https://dietpi.com/phpbb/viewtopic.php?p=68#p68
id 102 | =2 | rsyslog: system logging | | https://dietpi.com/phpbb/viewtopic.php?p=68#p68
id 103 | =2 | dietpi-ramlog: minimal, optimised logging | | https://dietpi.com/phpbb/viewtopic.php?p=68#p68
id 105 | =2 | openssh server: feature rich ssh server | | https://dietpi.com/phpbb/viewtopic.php?p=63#p63
id 152 | =2 | avahi-daemon: hostname broadcast (mac, pc bonjour) |
I note that dietpi-ramlog is still installed even though I have selected full logging. Is that correct?

Just looking, I think it might be netdata fiddling with permissions.

Code: Select all

root@DietPi:/var/log# ls -la
total 372
drwxr-xr-x  6 root    root    340 Feb 27 16:04 .
drwxr-xr-x 12 root    root   4096 Feb 24 14:58 ..
-rwxr-xr-x  1 root    root      0 Feb 24 15:08 alternatives.log
drwxr-xr-x  2 root    root    100 Feb 27 16:05 apt
-rwxr-xr-x  1 root    adm    1079 Feb 27 20:17 auth.log
-rwxr-xr-x  1 root    utmp      0 Feb 27 16:05 btmp
-rwxr-xr-x  1 root    adm   14171 Feb 27 16:32 daemon.log
-rwxr-xr-x  1 root    adm   36127 Feb 27 16:05 debug
-rwxr-xr-x  1 root    root      0 Feb 27 16:05 dpkg.log
-rwxr-xr-x  1 root    adm  108113 Feb 27 16:05 kern.log
-rwxr-xr-x  1 root    utmp    292 Feb 27 16:18 lastlog
drwxr-xr-x  2 root    root     60 Feb 27 16:04 letsencrypt
-rwxr-xr-x  1 root    adm   71908 Feb 27 16:05 messages
drwxr-sr-x  2 netdata adm     100 Feb 24 15:03 netdata
drwxr-xr-x  2 root    root     40 Feb 24 15:05 private
-rwxr-xr-x  1 root    adm  123342 Feb 27 20:17 syslog
-rwxr-xr-x  1 root    utmp   1920 Feb 27 16:18 wtmp
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Logrotate failing

Post by Joulinar »

what is now the permission of /var/log themselves ? did you set it back to 755?

regarding the RamLog, pls can you post the following

Code: Select all

journalctl -u dietpi-ramlog_disable.service
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: Logrotate failing

Post by baz123 »

Joulinar wrote: Thu Feb 27, 2020 10:05 pm what is now the permission of /var/log themselves ? did you set it back to 755?
No I have left it for now.
Joulinar wrote: Thu Feb 27, 2020 10:05 pm regarding the RamLog, pls can you post the following

Code: Select all

journalctl -u dietpi-ramlog_disable.service

Code: Select all

root@DietPi:~# journalctl -u dietpi-ramlog_disable.service
-- Logs begin at Fri 2020-02-28 16:16:30 GMT, end at Mon 2020-03-02 13:25:14 GMT. --
-- No entries --
In DietPi-Software it states "Log System : [Full]"

Code: Select all

root@DietPi:~# systemctl status dietpi-ramlog_disable.service
Unit dietpi-ramlog_disable.service could not be found.

root@DietPi:~# systemctl status dietpi-ramlog.service
● dietpi-ramlog.service - DietPi-RAMlog
   Loaded: loaded (/etc/systemd/system/dietpi-ramlog.service; enabled; vendor preset: enabled)
   Active: active (exited) since Fri 2020-02-28 16:16:31 GMT; 2 days ago
  Process: 270 ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs (code=exited, status=0/SUCCESS)
  Process: 272 ExecStart=/bin/dash -c /boot/dietpi/func/dietpi-ramlog 0 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramlog.log (code=exited, status=0/SUCCESS)
 Main PID: 272 (code=exited, status=0/SUCCESS)

Feb 28 16:16:31 DietPi systemd[1]: Starting DietPi-RAMlog...
Feb 28 16:16:31 DietPi systemd[1]: Started DietPi-RAMlog.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Logrotate failing

Post by Joulinar »

looks like ramlog was not deactivated correctly as you are missing dietpi-ramlog_disable.service

I would recommend to change logging back and try to re-initiate
  • change logging back > 1: RamLog
  • reboot
  • change logging > 3: FULL
  • reboot
  • check if dietpi-ramlog_disable.service exist
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply