Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#40443 - [cups] 1.7.2-1 logrotate cups.pid
Attached to Project:
Arch Linux
Opened by Paul Kerry (paulkerry) - Monday, 19 May 2014, 11:41 GMT
Last edited by Andreas Radke (AndyRTR) - Tuesday, 21 October 2014, 17:49 GMT
Opened by Paul Kerry (paulkerry) - Monday, 19 May 2014, 11:41 GMT
Last edited by Andreas Radke (AndyRTR) - Tuesday, 21 October 2014, 17:49 GMT
|
DetailsDescription: /etc/logrotate.d/cups contains reference to cups.pid which does not exist
Additional info: cups 1.7.2-1 /etc/logrotate.d/cups contains these lines... postrotate /bin/kill -HUP `cat /var/run/cups.pid 2>/dev/null` 2>/dev/null || true but /var/run/cups.pid does not exist, so the kill command does not execute I can confirm cups is running as a systemd service while this is happening... 529 ? Ss 0:03 /usr/bin/cupsd -f Steps to reproduce: install and start cups - no /var/run/cups.pid file is created. Cheers Paul. |
This task depends upon
Closed by Andreas Radke (AndyRTR)
Tuesday, 21 October 2014, 17:49 GMT
Reason for closing: Fixed
Additional comments about closing: 2.0.0-2
Tuesday, 21 October 2014, 17:49 GMT
Reason for closing: Fixed
Additional comments about closing: 2.0.0-2
http://pkgs.fedoraproject.org/cgit/cups.git/tree/cups-logrotate.patch?id=f01be03466d52d1d8f32171942e690a41b4ba222
If not I have no clue what we in a different way than Fedora or other distros.
previous versions of /etc/logrotate.d/cups were like this...
-
/var/log/cups/*_log {
missingok
notifempty
postrotate
/bin/kill -HUP `cat /var/run/cups.pid 2>/dev/null` 2>/dev/null || true
endscript
}
-
so how about changing the kill line to something on the lines of...
/usr/bin/kill -HUP `/usr/bin/pidof cupsd` || true
or maybe it would be preferable to use systemctl now to do this...
/usr/bin/systemctl kill -s HUP cups
or following examples in "man logrotate"...
/usr/bin/killall -HUP cups
?
For info, in Debian stable (using cups 1.5.3), /etc/logrotate.d/cups contains...
-
/var/log/cups/*log {
daily
missingok
rotate 7
sharedscripts
postrotate
if [ -e /var/run/cups/cupsd.pid ]; then
invoke-rc.d --quiet cups force-reload > /dev/null
sleep 10
fi
endscript
compress
notifempty
create 640 root lpadmin
}
-
but in Debian unstable using cups 1.7.3, the /etc/logrotate.d/cups file has been removed.
Cheers
Paul.
under the "Log Files" section says...
"Log files are rotated automatically by the scheduler when they reach the configured size limit, by default 1MB. If the limit is set to 0 then no rotation is performed in the scheduler - this mode is often used by Linux distributions so they can use the logrotated(8) program to rotate them instead."
As there is no "MaxLogSize" set in the default /etc/cups/cupsd.conf file, it would appear that cups is rotating the logs by it's internal mechanism and also /etc/logrotate.d/cups is rotating the logs, probably causing the problem.
So I guess there are two options here: add "MaxLogSize 0" to /etc/cups/cupsd.conf to use /etc/logrotate.d/cups or remove /etc/logrotate.d/cups completely
I'm testing this by putting "MaxLogSize 0" into /etc/cups/cupsd.conf and using a modified /etc/logrotate.d/cups file.
Cheers
Paul.
So I tested with "MaxLogSize 0" in /etc/cups/cupsd.conf and with a modified /etc/logrotate.d/cups file - as I commented before, new log files are created and rotated but aren't used.
I then tested with a small logsize, "MaxLogSize 10240" in /etc/cups/cupsd.conf and deleted the /etc/logrotate.d/cups file - everything works perfectly: logs are created, rotated and used.
Perhaps, as I mentioned before, this is an issue with both cups and logrotate doing the changes?
Cheers
Paul.
I've done more testing and have found the solution by changing the /etc/logrotate.d/cups file from the default settings. No patches to cups are required.
Adding this line to the /etc/cups/cupsd.conf file...
MaxLogSize 0
and changing the /etc/logrotate.d/cups file [with the relevant indentations as posting here removes these] to...
/var/log/cups/*_log {
missingok
notifempty
daily
rotate 14
sharedscripts
copytruncate
postrotate
/usr/bin/systemctl kill -s HUP cups
endscript
}
makes everything work perfectly: all logs are created, rotated and used as they should be.
Cheers
Paul.
[root@server64 andyrtr]# ls -lha /var/log/cups/
insgesamt 64K
drwxr-xr-x 2 root lp 4,0K 29. Sep 00:00 .
drwxr-xr-x 9 root root 4,0K 1. Okt 00:00 ..
-rw-r--r-- 1 root lp 511 3. Okt 10:26 access_log
-rw-r--r-- 1 root lp 125 14. Sep 13:59 access_log.1
-rw-r--r-- 1 root lp 124 1. Sep 20:32 access_log.2
-rw-r--r-- 1 root lp 122 17. Aug 09:37 access_log.3
-rw-r--r-- 1 root lp 634 16. Aug 20:20 access_log.4
-rw-r--r-- 1 root lp 104 2. Okt 12:44 error_log
-rw-r--r-- 1 root lp 524 2. Okt 12:43 error_log.1
-rw-r--r-- 1 root lp 210 21. Sep 17:53 error_log.2
-rw-r--r-- 1 root lp 210 18. Sep 20:46 error_log.3
-rw-r--r-- 1 root lp 3,1K 7. Sep 20:19 error_log.4
-rw-r--r-- 1 root lp 0 15. Sep 00:00 page_log
-rw-r--r-- 1 root lp 1,5K 14. Sep 13:59 page_log.1
-rw-r--r-- 1 root lp 1,2K 1. Sep 20:32 page_log.2
-rw-r--r-- 1 root lp 1,3K 17. Aug 09:37 page_log.3
-rw-r--r-- 1 root lp 1,4K 16. Aug 20:20 page_log.4
maybe there's no real problem?
I've added the sharedscripts option to our logrotate file like Fedora does into cups 2.0.0 package in testing. Please test if there's all working for you.
MaxLogSize size
Specifies the maximum size of the log files before they are rotated. The value "0" disables log rotation. The default is "1048576" (1MB).
So this setting shouldn't be required.
Also from your /var/log/cups directory listing, your log files seem to be created and rotated at random times.
Without adding MaxLogSize to cupsd.conf, what happens when you add "daily" to /etc/logrotate.d/cups ? Are the cups logs changed daily or not?
For info, debian stable /etc/cups/cupsd.conf says...
# Deactivate CUPS' internal logrotating, as we provide a better one, especially
# LogLevel debug2 gets usable now
MaxLogSize 0
by which it means logrotate is a better method than the cups built-in method.
sed -i -e '1iMaxLogSize 0' conf/cupsd.conf.in
postrotate
/usr/bin/systemctl kill -s HUP cups
endscript
so that cups is HUP'd when logrotate runs.
Cheers
Paul.