jump to navigation

It’s Official April 6, 2008

Posted by gnukathryn in BOINC, Configuration, Fedora, Nifty!, RPM.
3 comments

BOINC has been added to the Fedora 7 and higher repositories. You can use your favorite GUI front end or just do

# yum install boinc-client boinc-manager

The cool part is my logrotate config file is in the repositories as part of the package. I don’t know how geeky that makes me, but it sure did make me feel good. I don’t program, so there’s isn’t a whole lot I can do to give back to the Fedora community. So I think it’s cool that I was able to contribute in this small way.

BOINC Logrotate gotcha January 31, 2008

Posted by gnukathryn in BOINC, Configuration.
add a comment

In a previous post, I provided the logrotate config file I use for BOINC.  One “gotcha” just popped up.  The script stops the daemon before doing the rotation and then starts it again.  If for whatever reason you manually stopped the daemon, when cron runs logrotate, the daemon will be restarted.  I’m investigating ways of dealing with this.

Making Predictions January 3, 2008

Posted by gnukathryn in BOINC, Scripting, Software, Terminal.
add a comment

Yeah, I’m a BOINC junky. I’ll admit it. I’m finding that scripting is exceedingly useful for stuff I used to pull out pencil and paper for. I’m not programmer. Heck, I’m not much of a scripter. I’ve written exactly five scripts and only three of them actually work the way I want them to. But hey, a gal has to start somewhere.

One of the questions I frequently ask myself is how long will it take me to reach X number of credits in a certain project given my current RAC (recent average credit). There are variations on the question, but they all boil down to the same basic formula. You take your goal and subtract the number of credits you currently have and then divide by your RAC. Or to put it another way, (goal-credits)/rac. Easy.

Now it may seem sort of dumb to write a script to figure this out. I mean, it’s just as quick to pull out my calculator or do it in my head. OK, maybe it’s faster than doing it in my head. But it does give me practice in scripting. And that’s the important thing.

So here you go. If you have suggestions for improvements please leave them in the comments. Enjoy!

Oh yes, and sorry about all the extra comment marks. My HTML is even worse than my scripting. Not having any blank lines was the only way I could get everything to show up in one code block and using pre tags cut off the far right side of the text.

#
#!/bin/bash
#
# Use to predict the number of days until
# a certain number of BOINC credits will be reached.
#
# See http://boinc.berkeley.edu/ for more information on BOINC.
#
# This script makes use of the calculator feature in Bash.
# Because Bash is only able to do integer math,
# all values must be rounded to the nearest whole number.
#
# Kathryn Marks
# <kathryn.boinc@gmail.com>
#
# Created: January 3, 2008
# Last Modified: January 3, 2008
#
#
# Define our variables
# CREDITS is the current number of credits for a project
# RAC is the recent average credit for a project
# GOAL is the number of credits you want
# DAYS is the number of days until $GOAL is reached
#
# Start by initializing the variables
#
CREDITS=0
RAC=0
GOAL=0
DAYS=0
#
# Remind the user to use only integer values for CREDITS, RAC and GOAL
#
echo " "
echo "It's very important that you only put in whole numbers."
echo " "
#
# Have the user input values for CREDIT, RAC and GOAL
#
echo -n "Enter the number of credits you currently have > "
read CREDITS
#
echo -n "Enter your RAC > "
read RAC
#
echo -n "Enter your credit goal > "
read GOAL
#
# Now calculate the value of DAYS
#
DAYS=$(((GOAL - CREDITS) / RAC))
#
# Display the value of DAYS in user friendly way
#
echo "It will be approximately $DAYS day(s) until you reach your goal of $GOAL credits."
#
# EOF

Log rotation for BOINC December 30, 2007

Posted by gnukathryn in BOINC, Configuration, Utilities.
add a comment

If you’ve followed Eric’s instructions for installing BOINC as a daemon, then you may have found out that the messages you see in the message tab are captured in boinc.log. Any errors are captured in error.log. Here’s the problem. There’s no built in way to rotate those logs. So boinc.log and error.log keep growing and growing and… well you get the picture. And the last thing you want to do is run out of disk space. That’s never pretty. Never fear, there’s a handy dandy cron job that runs daily called logrotate. And it does exactly what it says it does. To rotate your BOINC logs you have to create a configuration file and place it in /etc/logrotate.d. The following is my configuration file. See man logrotate for full details on the options for the configuration file.

Just remember to use the correct path to the logs. Your’s may be in /home/boinc/ or some other location.

# 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
# Last Modified: December 28, 2007
#########################################

# Global Parameters

missingok
compress
delaycompress
notifempty
nomail

# Log Specific Parameters

# boinc.log
# Normal usage:
# Rotate weekly and keep about 2 months worth

/var/lib/boinc/boinc.log
{
weekly
rotate 8

create 664 boinc boinc
sharedscripts
prerotate
/etc/init.d/boinc stop
endscript
postrotate
/etc/init.d/boinc start
endscript
}

# error.log
# Normal usage:
# Rotate monthly and keep about 2 months worth

/var/lib/boinc/error.log
{
monthly
rotate 2

create 664 boinc boinc
sharedscripts
prerotate
/etc/init.d/boinc stop
endscript
postrotate
/etc/init.d/boinc start
endscript
}

## EOF ##

Notes to Self December 19, 2007

Posted by gnukathryn in BOINC, Fedora, Installing, RPM, Software, Terminal.
1 comment so far

I’m in the process of testing out a rpm for BOINC. Woo hoo!

Some notes to self:

  • After creating a tarball of one’s working install. One needs to move it somewhere for safe keeping. One’s data partition is a great place for said safe keeping. When one needs to move something to said partition, it helps if one mounts said partition before trying to move it. Somehow I think I now have a /Data directory hanging out somewhere. I’ll have to remove it once I find it.
  • rmdir only works on empty directories. If there are files in there, you have to use rm -r.
  • Using rm -r on a directory that has a metric ton of files takes a very long time because it runs in interactive mode. If one is really sure one wants to get rid of the whole thing, use rm -rf.
  • Once you remove a directory containing a file, the soft links pointing to said file break. And programs that need said link to file to function correctly will also break.
  • It is impossible to echo something > broken_soft_link_name. You must rm broken_soft_link_name first.
  • Wiping out a users home directory is a Bad Thing ®. Not having all the hidden config files causes Very Bad Things ® to happen, including not being able to access the account from the shell. Having a backup is a Good Thing ®. Knowing how to restore said backup is an Even Better Thing ®. And finding out that said restored backup works is an Extremely Good Thing ®.

.

Watch this space for further updates…