Message boards : BOINC client : Log file rotation on Linux not working
Message board moderation
Author | Message |
---|---|
Send message Joined: 8 Nov 05 Posts: 24 |
I've recently gotten back into BOINC after being away for a while. I'm running the current version, 7.2.42, on several Fedora 20 Linux systems. I've noticed that log file rotation is only partially functional. I've searched around this forum and google and not seen anyone else mention it. Sorry if this is a known bug or if I've done something wrong. Fedora 20 uses the systemd approach rather than boot scripts in /etc/rc*.d. The systemd file used to start the boinc clinet looks like this: [Unit] Description=Berkeley Open Infrastructure Network Computing Client After=network.target [Service] Nice=10 User=boinc PermissionsStartOnly=yes ExecStartPre=/bin/sleep 1 ExecStartPre=/usr/bin/touch /var/log/boinc.log /var/log/boincerr.log ExecStartPre=/usr/bin/chown boinc:boinc /var/log/boinc.log /var/log/boincerr.log ExecStart=/usr/bin/boinc --dir /var/lib/boinc ExecReload=/usr/bin/boinccmd --read_cc_config ExecStopPost=/bin/rm -f /var/lib/boinc/lockfile [Install] WantedBy=multi-user.target The file used by logrotate to rotate /var/log/boinc.log and /var/log/boincerr.log looks like this: # Log Rotation for BOINC Daemon Logs # # See http://boinc.berkeley.edu/ for more information about BOINC # # Daemon is stopped and then restarted after the logs are rotated. # # On restart, all results that checkpoint will fall back to the last one, if it exists. # On restart, all results that did not checkpoint will start from the beginning. # Author: Kathryn Marks <kathryn.boinc@gmail.com> # Created: October 6, 2007 # Modified: Milos Jakubicek <xjakub@fi.muni.cz> # Last Modified: July 19, 2009 ###################################################################### # service boinc-client start >& /dev/null /var/log/boinc.log /var/log/boincerr.log { missingok compress delaycompress notifempty nomail create 664 boinc boinc sharedscripts prerotate if [ -f /var/lib/boinc/lockfile ]; then touch /tmp/boinc_was_running service boinc-client stop >& /dev/null fi endscript postrotate if [ -f /tmp/boinc_was_running ]; then rm /tmp/boinc_was_running service boinc-client start >& /dev/null fi endscript } The log files get rotated. However, the logrotate file checks for the existence of /var/lib/boinc/lockfile to know if the boinc-client was running at the time. If so, it stops it before rotation and then restarts it after rotation. The problem is, lockfile does not exist. So, the client is never stopped and restarted and continues writing to the old files that have been rotated out of the way. I can manually stop and restart the client and it will write to the new log files as expected. So, where is lockfile supposed to come from? Is the boinc-client supposed to create it? It's not in my case. I believe all the file ownerships and permissions are correct. I have added a line in the systemd script for the boinc-client to touch the lockfile and that fixes the problem until a new version comes out and replaces the systemd file and removes my change. This is probably not a big deal. Boinc-client keeps right on running (as do any projects it's crunching.) I'm a Linux admin in real life so keeping track of log files is an important part of my job. Thanks for any help or suggestions. As I said, if this is a known bug, sorry for any confusion. Charlie Dennett |
Send message Joined: 20 Nov 12 Posts: 801 |
Stock BOINC creates the lockfile in its data directory. BOINC in Fedora may have been customized by Fedora package maintainers to put the lockfile somewhere else. Try ls -l /proc/[pid-of-BOINC]/fd if it helps. (BOINC normally logs to stdoutdae.txt and stderrdae.txt (and rotates them to .old), so either you or the package maintainers have customized that too.) |
Send message Joined: 8 Nov 05 Posts: 24 |
Thanks for the reply. No luck in proc: [charlie@oak 17474]$ sudo ls -la fd total 0 dr-x------ 2 boinc boinc 0 Apr 21 19:53 . dr-xr-xr-x 9 boinc boinc 0 Apr 20 13:18 .. lr-x------ 1 boinc boinc 64 Apr 21 19:59 0 -> /dev/null l-wx------ 1 boinc boinc 64 Apr 21 19:59 1 -> /var/log/boinc.log l-wx------ 1 boinc boinc 64 Apr 21 19:59 2 -> /var/log/boincerr.log l-wx------ 1 boinc boinc 64 Apr 21 19:59 3 -> /var/lib/boinc/time_stats_log lrwx------ 1 boinc boinc 64 Apr 21 19:59 4 -> socket:[917528] lr-x------ 1 boinc boinc 64 Apr 21 19:59 5 -> /proc/interrupts You're probably right about the Fedora maintainers. I have not customized a thing. I don't even have the source. I just install the rpm files. I'll see if there is any bug report over there. I'd be curious to know if other Linux users (Fedora or any other distro) see the same thing. Charlie |
Send message Joined: 8 Nov 05 Posts: 24 |
I looked through bugs reported in Fedora against boinc and found nothing relevant. I've submitted a bug report. It is BugID 1090051 Charlie |
Send message Joined: 20 Nov 12 Posts: 801 |
Looks like /usr/bin/boinc is wrapper for /usr/bin/boinc-client. The wrapper starts the client so that stdout and stderr are redirected to /var/log/. It also sets --allow_multiple_clients. Starting the client with --allow_multiple_clients changes the way BOINC works in a few ways. One of them is that the client doesn't create the lockfile anymore. Despite the comment I don't think it's necessary to set that option. Try removing it. |
Send message Joined: 8 Nov 05 Posts: 24 |
Thanks. Removing that option and restarting boinc-client caused the lockfile to appear. I'll note this on the bug report. Until they package maintainer fixes it, it will come back on the next update. Charlie |
Copyright © 2025 University of California.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software Foundation.