PDA

View Full Version : Can I move boinc from linux root?



cjspizz
11-16-19, 08:56 PM
Unlike most programs, boinc installed itself in root and keeps all the data files there. I allocated a generous 30GB to my root partition during install, but it's now ~60% full because of boinc. Anyone know why boinc makes its home in root? More importantly, does anyone know how I can move it (or at least move the data files to the /home partition)?

scole of TSBT
11-17-19, 09:57 AM
It's normally installed in /var/lib/ by default. You can't just move it if that's where the install script put it. Check your /etc/init.d/boinc-client script and see if the lines are the same as these...


BOINC_DIR=/var/lib/boinc-client
BOINC_CLIENT=/usr/bin/boinc

zombie67
11-17-19, 11:40 AM
In the past, I have just downloaded the app from the BOINC site, extracted it to my Desktop, and just run it form there. Works fine, assuming you are running a GUI.

cjspizz
11-17-19, 12:36 PM
It's normally installed in /var/lib/ by default. You can't just move it if that's where the install script put it. Check your /etc/init.d/boinc-client script and see if the lines are the same as these...


BOINC_DIR=/var/lib/boinc-client
BOINC_CLIENT=/usr/bin/boincYup, they're the same, and that's where everything is:

3054

But that's the problem. I was hoping to move BOINC_DIR to /home because my root partition is filling up.

3055

Is there any way to do that? Maybe stop taking new tasks, complete the tasks on hand, then uninstall/reinstall with new settings?

scole of TSBT
11-17-19, 02:03 PM
Try moving the folder to where you want and change the folder name in the boinc-client script and see if it works. It should because we run additional clients in other folders and that is only place the path is referenced by the installed scripts

cjspizz
11-18-19, 10:30 AM
That didn't work, partly because boinc wouldn't use the folder I designated (/home/cjspizz/boinc-dir). For some reason, it insisted on using /home/cjspizz instead.

I found this script a while back but haven't tried it, mainly because I'm not sure where to define the variables "$BOINC_DIR" and "$CONF_DIR." Where do I define those, and do you think this script will work?


#!/bin/sh
#
# This script can be used to move the BOINC data directory from Debian's
# default location in root '/var/lib/boinc-client' to a more sensible place,
# like your Home directory.
# Invoke it with the old data directory as it's only argument,
# for example:
# $ move-new-boinc-dir.sh /var/lib/boinc-client
#
# This file is licensed under the terms of the GNU General Public License,
# Version 2 or any later version published by the Free Software Foundation.


set -e


OLD_DIR="$1"
if [ -z "$OLD_DIR" ]; then
echo "Error: Old BOINC directory not specified."
exit 1
elif [ ! -d "$OLD_DIR" ]; then
echo "Error: $OLD_DIR does not exist or is not a directory."
exit 1
fi


BOINC_DIR=/home/boinc-client
CONF_DIR=/etc/boinc-client


mv_conffile()
{
if [ ! -L "$BOINC_DIR/$1" ] && [ -f "$BOINC_DIR/$1" ]; then
mv -f "$BOINC_DIR/$1" "$CONF_DIR/$1"
fi
ln -sf "$CONF_DIR/$1" "$BOINC_DIR/$1"
}


# Stop the BOINC core client.
invoke-rc.d boinc-client stop


# Copy the old BOINC directory to the new location.
mkdir -p $BOINC_DIR || true
cp -R -T "$OLD_DIR" $BOINC_DIR


# Set the user boinc as the owner for
# all files in /home/cjspizz/boinc-client.
chown -R boinc:boinc $BOINC_DIR || true


# Move old configuration files to /etc/boinc-client/ and
# create symlinks for the BOINC core client.
mv_conffile cc_config.xml
mv_conffile global_prefs_override.xml
mv_conffile gui_rpc_auth.cfg
mv_conffile remote_hosts.cfg


CA_FILE=/etc/ssl/certs/ca-certificates.crt
CA_LINK="$BOINC_DIR/ca-bundle.crt"
if [ ! -e $CA_LINK ] && [ -f $CA_FILE ]; then
ln -sf $CA_FILE $CA_LINK
fi


# Start the BOINC core client again.
invoke-rc.d boinc-client start

scole of TSBT
11-18-19, 02:45 PM
Going to be messy in /home/cjspizz. Try /home/cjspizz/boinc then set the owner and permissions...



sudo chmod 777 -R /home/cjspizz/boinc
sudo chown -R boinc:boinc /home/cjspizz/boinc

cjspizz
11-18-19, 03:30 PM
Yup, that's what I tried (/home/cjspizz/boinc-dir). It was boinc that wanted to make a mess in /home/cjspizz. There's another boinc-client script in /etc/default/ (it's the configuration script for the init script) that has the "BOINC_DIR=/var/lib/boinc-client" variable. I'm going to try changing that too and see if it helps. I'll report back, just in case others are interested.