FahCore and FAHClient running with root privileges

If you're new to FAH and need help getting started or you have very basic questions, start here.

Moderators: Site Moderators, FAHC Science Team

Post Reply
BDA
Posts: 4
Joined: Sun Oct 31, 2021 5:17 pm

FahCore and FAHClient running with root privileges

Post 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?

Image
gunnarre
Posts: 567
Joined: Sun May 24, 2020 7:23 pm
Location: Norway

Re: FahCore and FAHClient running with root privileges

Post 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.
Image
Online: GTX 1660 Super, GTX 1080, GTX 1050 Ti 4G OC, RX580 + occasional CPU folding in the cold.
Offline: Radeon HD 7770, GTX 960, GTX 950
BDA
Posts: 4
Joined: Sun Oct 31, 2021 5:17 pm

Re: FahCore and FAHClient running with root privileges

Post 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 :D
toTOW
Site Moderator
Posts: 6296
Joined: Sun Dec 02, 2007 10:38 am
Location: Bordeaux, France
Contact:

Re: FahCore and FAHClient running with root privileges

Post by toTOW »

It's a bug introduced in v7.6.21 installer ... :(
Image

Folding@Home beta tester since 2002. Folding Forum moderator since July 2008.
leloft
Posts: 3
Joined: Mon Mar 14, 2022 10:12 pm

Re: FahCore and FAHClient running with root privileges

Post 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
leloft
Posts: 3
Joined: Mon Mar 14, 2022 10:12 pm

Re: FahCore and FAHClient running with root privileges

Post 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
Joe_H
Site Admin
Posts: 7856
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: FahCore and FAHClient running with root privileges

Post 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.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
leloft
Posts: 3
Joined: Mon Mar 14, 2022 10:12 pm

Re: FahCore and FAHClient running with root privileges

Post by leloft »

Thank you for the information.
leloft
Joe_H
Site Admin
Posts: 7856
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: FahCore and FAHClient running with root privileges

Post 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
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
BDA
Posts: 4
Joined: Sun Oct 31, 2021 5:17 pm

Re: FahCore and FAHClient running with root privileges

Post 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.
PaulTV
Posts: 179
Joined: Mon Jan 25, 2021 4:53 pm
Location: Netherlands

Re: FahCore and FAHClient running with root privileges

Post 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).
Image

Ryzen 5800X / RTX 4090 / Windows 11
Ryzen 5600X / RTX 3070 Ti / Ubuntu 20.04
Ryzen 5600 / RTX 3060 Ti / Windows 11
BDA
Posts: 4
Joined: Sun Oct 31, 2021 5:17 pm

Re: FahCore and FAHClient running with root privileges

Post by BDA »

Oh, thanks!!
Joe_H
Site Admin
Posts: 7856
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: FahCore and FAHClient running with root privileges

Post 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.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
gunnarre
Posts: 567
Joined: Sun May 24, 2020 7:23 pm
Location: Norway

Re: FahCore and FAHClient running with root privileges

Post 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.
Image
Online: GTX 1660 Super, GTX 1080, GTX 1050 Ti 4G OC, RX580 + occasional CPU folding in the cold.
Offline: Radeon HD 7770, GTX 960, GTX 950
toTOW
Site Moderator
Posts: 6296
Joined: Sun Dec 02, 2007 10:38 am
Location: Bordeaux, France
Contact:

Re: FahCore and FAHClient running with root privileges

Post 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.
Image

Folding@Home beta tester since 2002. Folding Forum moderator since July 2008.
Post Reply