Bugzilla – Bug 8683
Squeezecenter .deb's logrotate should not restart SC
Last modified: 2009-09-08 09:18:22 UTC
With the default install of the squeezecenter's .deb, I get an email every day from cron telling me that squeezecenter was restarted. This is caused by the following chain of events: - The squeezecenter .deb installs a logrotate file that stops and starts squeezecenter when rotating its log files. - The logrotate program is run as a cron job, and cron is configured to email output of jobs by default. The solution is simply to redirect stdout to /dev/null when stopping and starting squeezecenter in the log file. This is what the attached patch does.
Created attachment 3548 [details] Patch
Why is the rotation happening every day? Maybe "size 200k" is too small?
I think it's because of all the warnings (about the cover.jpg files, etc.) when rescanning my music nightly. But it's not relevant to this bug report. I don't want to get an email every time squeezecenter is restarted by logrotate, even if it's once a week or once a month.
matt: can you review this patch?
I think the patch is fine... it is only affecting the logrotate script, which really (as he mentioned) probably shouldn't have any output at all.
The logrotate script in the RPM does the same thing as this patch to send output to /dev/null. However, I still think something else is broken here if the logs are being rotated every day. I suggest removing "size 200k" and testing.
Its not that unreasonable that his logs could be long... he might have turned some debugging on, or just have some noisy scanner results, or something.
Yeah, you're right. I'm not sure what I was thinking...
Should be solved in change 22518. This should be a totally reasonable fix as its almost the same as what we're doing in the RedHat logrotate config file.
Matt says this is fixed
Verified with SC 7.2 - 22892
This bug has been fixed in the 7.3.0 release version of SqueezeCenter! Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already. If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
The deb should not auto-restart SC to rotate logs! I'll do something with bug 1468 then this can be modified to use it.
Note: the RPM also does this.
Change 24754, USR1 will handle this for server.log. Matt/Fletch: Can you please update the deb/rpm scripts to use this? server.log needs a postrotate that sends USR1. scanner.log should not need any actions, as it is only written by the scanner.
Created attachment 4927 [details] rotate with USR1 Tested and works on Debian, so have applied similar lines to redhat, fedora and readynas. Can commit anytime if it's desired.
Created attachment 4928 [details] Better version Better, in that it allows the server to be restarted and rotated many times. The previous version used the /var/run/squeezecenter.pid, which would be the squeezecenter_safe process instead of slimserver.pl. pgrep finds the right pid and should hopefully work on all systems.
Thanks, feel free to apply.
Change 25546 has the patch for 7.3.3 please reopen if there are any issues with the change.
my logrotate for squeezecenter (debian etch) contains: # send USR1 to squeezecenter PID to reset logging /bin/kill -USR1 `pgrep slimserver.pl 2>/dev/null` 2>/dev/null || : this doesn't look right. there is no process with slimserver.pl in its command line. don't you want to be searching for squeezecenter-server? pgrep squeezecenter-s gets the right answer on my system. (15 charater limit)
are you sure that's not resetting squeezecenter_safe? It will work by doing that, but only once as it then fails to restart and can't be found again when restarting the process.
sorry my mistake, s/_/-/. fixed at change 25580. thanks.
This bug has been fixed in the 7.3.3 release version of SqueezeCenter! If you haven't already. please download the new version from http://www.logitechsqueezebox.com/support/download-squeezecenter.html If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.