BOINC does not write in logs

Message boards : BOINC client : BOINC does not write in logs
Message board moderation

To post messages, you must log in.

AuthorMessage
Germano

Send message
Joined: 21 May 16
Posts: 37
Italy
Message 69681 - Posted: 21 May 2016, 11:29:23 UTC

Hi, I am the Fedora's BOINC co-maintainer.
We just upgraded BOINC client to 7.6.x from 7.4.x and I am trying to figure out why BOINC does not write logs.
I attach boinc-client.service and logrotate.d/boinc-client

/usr/lib/systemd/system/boinc-client.service
[Unit]
Description=Berkeley Open Infrastructure Network Computing Client
Documentation=man:boinc(1)
After=network-online.target

[Service]
Type=forking
Nice=10
User=boinc
PermissionsStartOnly=yes
WorkingDirectory=/var/lib/boinc
ExecStartPre=/usr/bin/touch /var/log/boinc.log /var/log/boincerr.log
ExecStartPre=/bin/chown boinc:boinc /var/log/boinc.log /var/log/boincerr.log
ExecStart=/usr/bin/boinc_client --daemon --start_delay 1
ExecStop=/usr/bin/boinccmd --quit
ExecReload=/usr/bin/boinccmd --read_cc_config
ExecStopPost=/bin/rm -f /var/lib/boinc/lockfile
IOSchedulingClass=idle

[Install]
WantedBy=multi-user.target


/etc/logrotate.d/boinc-client
/var/log/boinc.log /var/log/boincerr.log {
        missingok
        notifempty
        copytruncate
        compress
        delaycompress
        nomail
}
ID: 69681 · Report as offensive
Profile Jord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15480
Netherlands
Message 69682 - Posted: 21 May 2016, 12:27:25 UTC

# log files
#LOGFILE=/var/log/${BOINCEXE_NAME}.log
#ERRORLOG=/var/log/${BOINCEXE_NAME}_err.log

# Add this option if you want to redirect logging to the files stderrdae.txt
# and stdoutdae.txt in BOINCDIR rather than LOGFILE and ERRORLOG
#BOINCOPTS="--redirectio"

Source.
ID: 69682 · Report as offensive
Germano

Send message
Joined: 21 May 16
Posts: 37
Italy
Message 69686 - Posted: 21 May 2016, 14:14:47 UTC
Last modified: 21 May 2016, 14:21:49 UTC

# log files
#LOGFILE=/var/log/${BOINCEXE_NAME}.log
#ERRORLOG=/var/log/${BOINCEXE_NAME}_err.log

# Add this option if you want to redirect logging to the files stderrdae.txt
# and stdoutdae.txt in BOINCDIR rather than LOGFILE and ERRORLOG
#BOINCOPTS="--redirectio"

Source.


The situation is the same


/usr/lib/systemd/system/boinc-client.service
[Unit]
Description=Berkeley Open Infrastructure Network Computing Client
Documentation=man:boinc(1)
After=network-online.target

[Service]
Type=forking
Nice=10
User=boinc
Group=boinc
PermissionsStartOnly=yes
WorkingDirectory=/var/lib/boinc
ExecStartPre=/usr/bin/touch /var/log/boinc.log /var/log/boinc_err.log
ExecStartPre=/bin/chown boinc:boinc /var/log/boinc.log /var/log/boinc_err.log
ExecStart=/usr/bin/boinc_client --daemon --start_delay 1
ExecStop=/usr/bin/boinccmd --quit
ExecReload=/usr/bin/boinccmd --read_cc_config
ExecStopPost=/bin/rm -f /var/lib/boinc/lockfile
IOSchedulingClass=idle
Environment="LOGFILE=/var/log/boinc.log"
Environment="ERRORLOG=/var/log/boinc_err.log"

[Install]
WantedBy=multi-user.target


# ls -latr /var/log/boinc*
-rw-r--r--. 1 boinc boinc 0 21 mag 15.58 /var/log/boinc.log
-rw-r--r--. 1 boinc boinc 0 21 mag 15.58 /var/log/boinc_err.log


A entry from top
25657 boinc     39  19   76756  36704   2088 R  64,7  0,2   9:49.40 wcgrid_mcm1_7.3
ID: 69686 · Report as offensive
ChristianB
Volunteer developer
Volunteer tester

Send message
Joined: 4 Jul 12
Posts: 321
Germany
Message 69688 - Posted: 21 May 2016, 16:36:47 UTC

It works on Debian. You can take a look at the systemd service file there: https://anonscm.debian.org/cgit/pkg-boinc/boinc.git/tree/debian/boinc-client.service
ID: 69688 · Report as offensive
Germano

Send message
Joined: 21 May 16
Posts: 37
Italy
Message 69765 - Posted: 27 May 2016, 10:02:04 UTC - in response to Message 69688.  
Last modified: 27 May 2016, 10:04:12 UTC

It works on Debian. You can take a look at the systemd service file there: https://anonscm.debian.org/cgit/pkg-boinc/boinc.git/tree/debian/boinc-client.service

I am often in contact with the Debian maintainer and he told me that that configuration was taken from Fedora old script file (BOINC 7.2.x)
The systemd script file I pasted here is an evolution of the older one, that avoids BOINC from running SELinux-unconfined (See https://bugzilla.redhat.com/show_bug.cgi?id=1303070 )

Anyway we are fixing the logs problem, see https://bugzilla.redhat.com/show_bug.cgi?id=1339002
Anyway I am still curious about why BOINC uses its working directory as logs directory[/url]
ID: 69765 · Report as offensive
ChristianB
Volunteer developer
Volunteer tester

Send message
Joined: 4 Jul 12
Posts: 321
Germany
Message 69766 - Posted: 27 May 2016, 11:30:36 UTC

Because BOINC was written with the idea that it runs in it's own directory under the users home directory.

Is /var/log a universal place on Linux or would we need to provide a build/configuration option so that could be changed by the distribution maintainer?

I also see some other problems with the systemd script right now that are mainly needed for debuging. Sometimes I want to start the Client with some extra commandline parameters. These were easily added to the init.d script but are not easily added to the systemd file. The relevant flags are broken right now and I have to directly edit the configuration file to activate the flag.

Regards
Christian
ID: 69766 · Report as offensive
Germano

Send message
Joined: 21 May 16
Posts: 37
Italy
Message 69777 - Posted: 28 May 2016, 8:54:02 UTC

I would need to know, in BOINC source code, where is the code that initializes and fills the logs. So that I could write a patch file (for Fedora) that makes BOINC write logs into /var/log/ directory, avoiding the package maintainer to have to mess up with symbolic links, etc.

I have done a quick search with "grep" but I haven't found much useful stuff
ID: 69777 · Report as offensive
ChristianB
Volunteer developer
Volunteer tester

Send message
Joined: 4 Jul 12
Posts: 321
Germany
Message 69830 - Posted: 31 May 2016, 7:15:04 UTC
Last modified: 31 May 2016, 7:15:37 UTC

Here are some pointers in the right direction:

When starting the Client with the --redirectio option the Client redirects stdout and stderr to files that are specified in client/main.cpp
For the actual path check lib/diagnostics.cpp

I would like to encourage you to not focus on the Fedora use case but create a patch that works for other Distributions too and can be incorporated into the upstream BOINC source. To discuss this further please open a Pull Request on the BOINC github repository.
ID: 69830 · Report as offensive
Germano

Send message
Joined: 21 May 16
Posts: 37
Italy
Message 69947 - Posted: 3 Jun 2016, 21:50:20 UTC

Thank you, I will start working on it as soon as possible
ID: 69947 · Report as offensive
MarkJ
Volunteer tester
Help desk expert

Send message
Joined: 5 Mar 08
Posts: 272
Australia
Message 70502 - Posted: 27 Jun 2016, 11:38:27 UTC
Last modified: 27 Jun 2016, 11:39:04 UTC

You might want to look at Debian bug 815214 that I raised for Stretch. It seems under Stretch their init script is totally different to the prior release (Jessie) and stuffs up the log files.

The solution that was implemented is in my opinion wrong. You may also want to chat with Gianfranco as he is the Debian BOINC maintainer.
MarkJ
ID: 70502 · Report as offensive

Message boards : BOINC client : BOINC does not write in logs

Copyright © 2024 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.