Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

/etc/logrotate.conf: Suggested Fixes

Featured Replies

I'm not sure if it's just my version of logrotate.conf or the stock version.

I think I have the stock version, but it does not seem to work.

 

Has anyone encountered the issue where the syslogs are not rotated?

 

The reason I found it is I was updating the powerdown package to call the syslog capture/dump during logrotate.

This would call /etc/rc.d/rc.unRAID syslog to capture the current syslog to your boot flash if it is going to be rotated.

 

Here is my output.

root@Atlas /tmp #ls -l /var/log/syslog
-rw-r--r-- 1 root root 1842326 Oct  4 17:27 /var/log/syslog

root@Atlas /tmp #logrotate -v /etc/logrotate.conf
reading config file /etc/logrotate.conf
reading config info for /var/log/wtmp 
error: /etc/logrotate.conf:25 unknown unit 'K'

 

 

and my fix

root@Atlas /tmp #cat /tmp/fix.sh 
echo "Fixing broken /etc/logrotate.conf"
# set -x -v
BLINE='/bin/kill -HUP cat /var/run/syslogd.pid.*'
GLINE='/bin/kill -HUP `cat /var/run/syslogd.pid 2>/dev/null` 2>/dev/null || true'
sed --in-place=.bak -e 's/10K/10k/g' -e 's/#compress.*/compress/g' -e "s#${BLINE}#${GLINE}#g" /etc/logrotate.conf

root@Atlas /tmp #sh /tmp/fix.sh 
Fixing broken /etc/logrotate.conf

 

 

Suggested Patch

--- /etc/logrotate.conf.bak     2008-10-04 17:27:51.364248764 -0400
+++ /etc/logrotate.conf 2008-10-04 17:30:27.052939282 -0400
@@ -18,18 +18,18 @@
create

# uncomment this if you want your log files compressed:
-#compress
+compress

# Rotate /var/log/wtmp:
/var/log/wtmp {
-    size 10K
+    size 10k
     create 0664 root utmp
     rotate 1
}

# Rotate /var/log/btmp:
/var/log/btmp {
-    size 10K
+    size 10k
     create 0600 root root
     rotate 1
}
@@ -43,6 +43,6 @@
/var/log/syslog {
     size 1M
     postrotate
-       /bin/kill -HUP cat /var/run/syslogd.pid 2>/dev/null 2>/dev/null || true
+       /bin/kill -HUP `cat /var/run/syslogd.pid 2>/dev/null` 2>/dev/null || true
     endscript
}

 

 

Output after fix.sh

root@Atlas /tmp #logrotate -v /etc/logrotate.conf
reading config file /etc/logrotate.conf
reading config info for /var/log/wtmp 
reading config info for /var/log/btmp 
reading config info for /var/log/syslog 

Handling 3 logs

rotating pattern: /var/log/wtmp  1048576 bytes (1 rotations)
empty log files are rotated, only log files >= 10240 bytes are rotated, old logs are removed
considering log /var/log/wtmp
error: stat of /var/log/wtmp failed: No such file or directory

rotating pattern: /var/log/btmp  1048576 bytes (1 rotations)
empty log files are rotated, only log files >= 10240 bytes are rotated, old logs are removed
considering log /var/log/btmp
  log does not need rotating

rotating pattern: /var/log/syslog  1048576 bytes (2 rotations)
empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed
considering log /var/log/syslog
  log needs rotating
rotating log /var/log/syslog, log->rotateCount is 2
renaming /var/log/syslog.2.gz to /var/log/syslog.3.gz (rotatecount 2, logstart 1, i 2), 
renaming /var/log/syslog.1.gz to /var/log/syslog.2.gz (rotatecount 2, logstart 1, i 1), 
renaming /var/log/syslog.0.gz to /var/log/syslog.1.gz (rotatecount 2, logstart 1, i 0), 
old log /var/log/syslog.0.gz does not exist
renaming /var/log/syslog to /var/log/syslog.1
creating new log mode = 0644 uid = 0 gid = 0
running postrotate script
compressing log with: /bin/gzip
removing old log /var/log/syslog.3.gz

  • 3 months later...

FYI this is still broke in 4.4.2

 

Combined with the problem where unRAID reports a dupe file every time it sees it and 24*7 operation you end up with ridiculous sized syslog which at best slow unRAID down and at best crash it.

 

Please fix :)

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.