Initial Commit

This commit is contained in:
mrkmntal 2025-11-07 17:37:30 -05:00
commit 3e5d6d88f3
17 changed files with 1109 additions and 0 deletions

25
DEBIAN/control Normal file
View file

@ -0,0 +1,25 @@
Package: fah-client
Version: 8.4.9
Maintainer: Joseph Coffland <joseph@cauldrondevelopment.com>
Priority: optional
Section: science
Bugs: https://github.com/FoldingAtHome/fah-client-bastet
Homepage: https://foldingathome.org/
Depends: ca-certificates, libexpat1, libc6 (>= 2.17), libsystemd0 (>= 222)
Pre-Depends: adduser, procps
Recommends: nvidia-opencl-icd
Suggests: python3-websocket
Conflicts: FAHClient, fahclient
Replaces: FAHClient, fahclient
Architecture: amd64
Installed-Size: 8024
Description: Folding@home Client
Folding@home performs research on human diseases using the computing resources of volunteers.
.
Folding@home client software which downloads and runs Folding@home simulation work units.
.
Finished work units are returned to the Folding@home servers for points.
.
Fold on your own or in a team. Compete with folders around the world to earn the most points while contributing to science.
.
Monitor and control the client via your browser.

4
DEBIAN/copyright Normal file
View file

@ -0,0 +1,4 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://v8-4.foldingathome.org/
License: GPL-3.0-or-later
Copyright: 2023-2024, foldingathome.org

76
DEBIAN/postinst Executable file
View file

@ -0,0 +1,76 @@
#!/bin/sh -e
NAME=fah-client
CLIENT_CONFIG=/etc/$NAME
CLIENT_HOME=/var/lib/$NAME
CLIENT_LOGS=/var/log/$NAME
# Create directories
install -d -m 755 -o $NAME -g $NAME $CLIENT_HOME $CLIENT_LOGS $CLIENT_CONFIG
# Migrate v7 configuration
# Remove obsolete symlink installed by previous v8 packages
[ -L $CLIENT_HOME/config.xml ] && rm -f $CLIENT_HOME/config.xml || true
if [ ! -e $CLIENT_CONFIG/config.xml ]; then
if [ -f /etc/fahclient/config.xml ]; then
cp --remove-destination /etc/fahclient/config.xml $CLIENT_CONFIG/
echo
echo "v7 client configuration copied to $CLIENT_CONFIG/config.xml"
echo
echo "It's recommended to purge the old package to remove leftover files:"
echo
echo " sudo apt purge fahclient"
elif [ -f $CLIENT_HOME/config.xml ]; then
mv -f $CLIENT_HOME/config.xml $CLIENT_CONFIG/
else
echo "<config/>" > $CLIENT_CONFIG/config.xml
fi
chown $NAME:$NAME $CLIENT_CONFIG/config.xml
chmod 0644 $CLIENT_CONFIG/config.xml
elif [ -f $CLIENT_HOME/config.xml ]; then
echo
echo "Warning: $CLIENT_HOME/config.xml ignored, using $CLIENT_CONFIG/config.xml"
fi
systemctl daemon-reload || true
# Add/update state file, required for purge action in postrm
deb-systemd-helper update-state $NAME.service || true
# Only enable on initial install
if [ -z "$2" ]; then
systemctl -q enable $NAME || true
systemctl start $NAME || true
else
# Upgrade
# Reenable if fixing broken symlink
if dpkg --compare-versions "$2" lt 8.2.1; then
systemctl -q enable $NAME || true
fi
systemctl restart $NAME || true
fi
echo
echo "The Folding@home client is now installed"
echo
echo "File locations:"
echo
echo " Logs: /var/log/$NAME"
echo " Data: /var/lib/$NAME"
echo
echo "Service commands:"
echo
echo " systemctl status --no-pager -l $NAME"
echo " sudo systemctl start $NAME"
echo " sudo systemctl stop $NAME"
echo " sudo systemctl restart $NAME"
echo
echo "Access the web interface by going to:"
echo
echo " https://v8-4.foldingathome.org/"
echo

21
DEBIAN/postrm Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh -e
NAME=fah-client
case "$1" in
remove)
systemctl daemon-reload || true
;;
purge)
# Disable service
deb-systemd-helper purge $NAME.service || true
# Remove all files
rm -rf /etc/$NAME /var/lib/$NAME /var/log/$NAME
# Remove user and group
deluser --quiet $NAME || true
delgroup --quiet $NAME || true
;;
esac

40
DEBIAN/preinst Executable file
View file

@ -0,0 +1,40 @@
#!/bin/sh -e
NAME=fah-client
CLIENT_HOME=/var/lib/$NAME
case "$1" in
install)
# Old v7 init script is broken and does not stop when told so
if [ -e /etc/init.d/FAHClient ]; then
systemctl kill FAHClient 2>/dev/null || true
# Missing PID file in init scripts cripples systemd monitoring,
# requiring manual waiting for process exit
TRY=0
while pgrep -x FAHClient >/dev/null && [ $TRY -lt 120 ]; do
sleep 1
TRY=$((TRY+1))
done
fi
# Create group if it does not exist
if ! getent group $NAME >/dev/null; then
groupadd --system $NAME || true
fi
# Create user if it does not exist
if ! getent passwd $NAME >/dev/null; then
useradd --system --gid $NAME --shell /usr/sbin/nologin \
--home-dir $CLIENT_HOME --no-create-home \
--groups video,render $NAME || true
fi
;;
upgrade)
# Remove broken symlink installed by previous v8 packages
if dpkg --compare-versions "$2" lt 8.2.1; then
systemctl -q disable $NAME || true
fi
;;
esac

9
DEBIAN/prerm Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh -e
NAME=fah-client
case "$1" in
remove)
systemctl stop $NAME || true
;;
esac