Page 1 of 1
FahCore and FAHClient running with root privileges
Posted: Sun Oct 31, 2021 5:24 pm
by BDA
Hi!
I just downloaded the Debian fahclient package and installed it. The program started folding with no further setup, but with root privileges, not using a fahclient user as the install guide says. Can this be changed? Is there a work-around?

Re: FahCore and FAHClient running with root privileges
Posted: Sun Oct 31, 2021 8:01 pm
by gunnarre
First run these two commands (without sudo if you are in a root shell):
Code: Select all
sudo adduser fahclient video
sudo adduser fahclient render
Create a file called
/etc/systemd/system/FAHClient.service
(use that exact filename to make sure it pre-empts the init.d script)
with the following content:
Code: Select all
[Unit]
Description=Folding@Home Client
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/FAHClient /etc/fahclient/config.xml --pid-file=/var/run/fahclient/fahclient.pid --daemon
PIDFile=/var/run/fahclient/fahclient.pid
User=fahclient
RuntimeDirectory=fahclient
WorkingDirectory=~
[Install]
WantedBy=multi-user.target
Then reboot and run the commands
Code: Select all
sudo systemctl start FAHClient.service
sudo systemctl enable FAHClient.service
That should let you run the service in way that uses the right user (fahclient) and still has acess to the GPUs.
Re: FahCore and FAHClient running with root privileges
Posted: Sun Oct 31, 2021 9:12 pm
by BDA
Thanks!
gunnarre wrote:First run these two commands (without sudo if you are in a root shell):
Code: Select all
sudo adduser fahclient video
sudo adduser fahclient render
This machine doesn't have a GPU slot, so I assume this is not needed.
I tried the rest and it worked

Re: FahCore and FAHClient running with root privileges
Posted: Mon Nov 01, 2021 7:14 pm
by toTOW
It's a bug introduced in v7.6.21 installer ...

Re: FahCore and FAHClient running with root privileges
Posted: Wed Mar 23, 2022 10:10 am
by leloft
Hello folders,
toTOW wrote:It's a bug introduced in v7.6.21 installer ...

This is my first post to the forum. I am running Devuan Chimaera on several machines and I'd like to use the lab ones for folding@home. I have difficulties installing the fahcontrol and fahviewer packages, although fahclient is running and folding its 19th WU. However, the client is running with root privileges and I am unable to find a 'don't download a new WU so that I can reinstall fahclient' button (obviously I am describing a function not an actual button title!) so at the end of this WU, I'm going to stop folding via Web Control and uninstall the fahclient, with a view to installing a version that doesn't have the python2 dependencies. My questions are these: which version should I download and install and how do I follow the above procedure for a sysVinit system to ensure that the client doesn't run as root?
Many thanks,
leloft
Re: FahCore and FAHClient running with root privileges
Posted: Wed Mar 23, 2022 12:07 pm
by leloft
Replying to my own (as yet uncleared by mods) post. Found solution for the issue about root privileges. I uninstalled v7.6.21 and installed v7.6.13 and rebooted. FAHCore and FAHClient now running as user fahclient. However, have issue with Web Control: used 'Stop folding after WU finished' option in the 'stop folding' button, but now I cannot see a toggle option i.e. to download a new WU and continue folding after the current one is finished. I'd prefer to use some kind of terminal interface via ssh if I could, but I'm caught up in this python2/Debian 10 issue.
leloft
Re: FahCore and FAHClient running with root privileges
Posted: Wed Mar 23, 2022 2:46 pm
by Joe_H
The Python 2 decencies exist in all versions of the version 7 client, specifically in FAHControl. Other developers have taken the open source code for FAHControl and provided an updated version that will use Python 3. Links to that have been posted here before.
There will not be an official distribution of a fixed FAHControl for version 7. They are currently working on a version 8 client, that may be released for beta testing later this year or early next year.
Re: FahCore and FAHClient running with root privileges
Posted: Wed Mar 23, 2022 3:35 pm
by leloft
Thank you for the information.
leloft
Re: FahCore and FAHClient running with root privileges
Posted: Wed Mar 23, 2022 4:28 pm
by Joe_H
I located a post with the download location for the updated FAHControl that uses Python 3 -
https://github.com/cdberkstresser/fah-control
Re: FahCore and FAHClient running with root privileges
Posted: Wed Mar 23, 2022 9:57 pm
by BDA
Joe_H wrote:There will not be an official distribution of a fixed FAHControl for version 7. They are currently working on a version 8 client, that may be released for beta testing later this year or early next year.
Is a non-gui fahcontrol planned? I run fahclient in a headless machine (through ssh) and, lacking fahcontrol, I can't see what project I'm currently computing for, nor does it appear in my statistics page, like it does in boinc projects.
Re: FahCore and FAHClient running with root privileges
Posted: Thu Mar 24, 2022 6:51 am
by PaulTV
Unfortunately queie-info isn't pretty printed, but this may help:
Code: Select all
root@fah1:/etc/fahclient# /usr/bin/FAHClient --send-command queue-info
06:45:52:Connecting to 127.0.0.1:36330
PyON 1 units
[
{"id": "02", "state": "RUNNING", "error": "NO_ERROR", "project": 18420, "run": 51, "clone": 3, "gen": 34, "core": "0xa8", " unit": "0x0000000300000022000047f400000033", "percentdone": "86.70%", "eta": "5 hours 30 mins", "ppd": "310045", "creditestim ate": "534326", "waitingon": "", "nextattempt": "0.00 secs", "timeremaining": "8.51 days", "totalframes": 100, "framesdone": 86, "assigned": "2022-03-22T18:59:51Z", "timeout": "2022-03-29T18:59:51Z", "deadline": "2022-04-01T18:59:51Z", "ws": "129.32. 209.203", "cs": "129.32.209.201", "attempts": 0, "slot": "00", "tpf": "24 mins 49 secs", "basecredit": "255850"},
{"id": "01", "state": "RUNNING", "error": "NO_ERROR", "project": 17768, "run": 41, "clone": 0, "gen": 111, "core": "0x22", "unit": "0x000000000000006f0000456800000029", "percentdone": "31.64%", "eta": "41 mins 01 secs", "ppd": "3062403", "creditest imate": "127600", "waitingon": "", "nextattempt": "0.00 secs", "timeremaining": "1.99 days", "totalframes": 100, "framesdone" : 31, "assigned": "2022-03-24T06:26:21Z", "timeout": "2022-03-25T06:26:21Z", "deadline": "2022-03-26T06:26:21Z", "ws": "128.1 74.73.74", "cs": "128.252.203.14", "attempts": 0, "slot": "01", "tpf": "36.00 secs", "basecredit": "21361"}
]
---
root@fah1:/etc/fahclient# /usr/bin/FAHClient --send-command slot-info
06:47:05:Connecting to 127.0.0.1:36330
PyON 1 slots
[
{
"id": "00",
"status": "FINISHING",
"description": "cpu:10",
"options": {"cpus": 10, "paused": False},
"reason": "",
"idle": False
},
{
"id": "01",
"status": "RUNNING",
"description": "gpu:7:0 GA104 [GeForce RTX 3060 Ti Lite Hash Rate]",
"options": {"pause-on-start": True, "paused": False, "pci-bus": "7", "pci-slot": "0"},
"reason": "",
"idle": False
}
]
---
Also, you could have a look at HFM.
My server running home-build status pages telnets to my folding clients and executes those queue-info and slot-info commands. To do so, you'll have to set up access control in the config.xml file (there's info on that on the forum, or if you want I can post an example).
Re: FahCore and FAHClient running with root privileges
Posted: Thu Mar 24, 2022 7:50 am
by BDA
Oh, thanks!!
Re: FahCore and FAHClient running with root privileges
Posted: Thu Mar 24, 2022 3:03 pm
by Joe_H
BDA wrote:Joe_H wrote:There will not be an official distribution of a fixed FAHControl for version 7. They are currently working on a version 8 client, that may be released for beta testing later this year or early next year.
Is a non-gui fahcontrol planned? I run fahclient in a headless machine (through ssh) and, lacking fahcontrol, I can't see what project I'm currently computing for, nor does it appear in my statistics page, like it does in boinc projects.
I don't know full details, based on what is visible on the GitHub public repositories there will be a web GUI similar to the current Web Control and a background client. I have not looked deeper into the actual code posted publicly. They may publish an API like what exists for the current client for connecting third party apps to the client, but will have to see what gets posted as they get further along.
Re: FahCore and FAHClient running with root privileges
Posted: Fri Mar 25, 2022 3:46 pm
by gunnarre
leloft wrote:Found solution for the issue about root privileges. I uninstalled v7.6.21 and installed v7.6.13 and rebooted.
Please don't run old versions of the client, due to security. See the solution further up in the thread for how to run the client as the fahclient user rather than root.
Re: FahCore and FAHClient running with root privileges
Posted: Sun Mar 27, 2022 9:41 pm
by toTOW
BDA wrote:Is a non-gui fahcontrol planned? I run fahclient in a headless machine (through ssh) and, lacking fahcontrol, I can't see what project I'm currently computing for, nor does it appear in my statistics page, like it does in boinc projects.
No, but you can control your headless client remotely from a machine that has FAHControl (or HFM) installed.