Why my time as a donor was only a few hours

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
vincewebb
Posts: 3
Joined: Sat Dec 05, 2020 8:07 pm
Location: Buenos Aires

Why my time as a donor was only a few hours

Post by vincewebb »

Hello
I am very much in agreement with the objectives of Folding At Home, thus I was enthused by the opportunity to help. I installed the FAH Client on a Debian based Linux box and was quickly disappointed.

I was shocked to see the FAH Client running as root, not a good start.

I had read that there is some sort of visibility via a web page but found no indication of where that webpage might be. To try and find it I looked for open ports where I could point my browser, I found the following:
FAHClient 28211 root 7u IPv4 241063 0t0 TCP *:7396 (LISTEN)
FAHClient 28211 root 8u IPv4 241064 0t0 TCP *:36330 (LISTEN)

Thus I tried both:
127.0.0.1:7396/
127.0.0.1:36330/

No joy there.

Given that the FAH Client runs as root, I was reluctant to install any more FAH software. I went ahead anyway and installed the FAH Viewer, great it shows cool stuff but it doesn't give any control over the FAH client.

If the FAH Client ran as a normal user and the client provided a web interface to view and control it, I would have been a happy bunny and this computer would still be running FAH. As it was, I found it soaked up too much CPU and the only way I managed to stop it was to uninstall it.

Was I wrong to form such a low opinion so quickly ?

Best regards, Vince
JimboPalmer
Posts: 2574
Joined: Mon Feb 16, 2009 4:12 am
Location: Greenwood MS USA

Re: Why my time as a donor was only a few hours

Post by JimboPalmer »

[I fold on Windows, my only 'experience' with Linux is when it is similar to Unix.]

FAHViewer is the vestigal remnant of a screensaver to see how the protein folds, the GUI control is called FAHControl.

By design, F@H attempt to use 100% of your CPU at a very low priority. You can specify how many threads to use, (F@H calls them CPUs) but by default it uses 100%.

If you have other very low priority tasks, F@H can interact oddly.
Tsar of all the Rushers
I tried to remain childlike, all I achieved was childish.
A friend to those who want no friends
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Why my time as a donor was only a few hours

Post by bruce »

The FAH install script is not designed to run as root, but rather to create a new user called FAHClient (or something like that) with very limited privileges. Certainly it WILL run as root, depending on how you install it but we certainly don't recommend it.

How did you install it?
vincewebb
Posts: 3
Joined: Sat Dec 05, 2020 8:07 pm
Location: Buenos Aires

Re: Why my time as a donor was only a few hours

Post by vincewebb »

I installed the client by clicking on the downloaded .deb file.
In my case this was:
fahclient_7.6.21_arm64.deb
I was logged in as myself at the time, not root.

The operating system is Ubuntu 20:10
floyd
Posts: 5
Joined: Sun Dec 06, 2020 2:00 pm

Re: Why my time as a donor was only a few hours

Post by floyd »

In fact the client is started by root but is supposed to drop privileges. 7.6.13 does so but 7.6.21 does not, it continues to run under the root account and so do the cores. That's why I won't switch.
Joe_H
Site Admin
Posts: 7875
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: Why my time as a donor was only a few hours

Post by Joe_H »

Part of the issues that you can run into using the most recent versions of Linux such as Ubuntu 20 is that the F@h app and its installer date back to when Ubuntu 16.04 and 18.04 were current. Though the various 7.6 versions have a number of updates, most of those were not aimed at improving compatibility with later distributions of Linux.

As bruce mentioned, FAHClient should be running under a limited privileged account, I recall it is fahclient on linux. as floyd has mentioned, the most recent version of the install has a bug where it does not. There may be a problem report on the F@h GitHub site - https://github.com/FoldingAtHome/fah-issues/issues, I have not gone through them recently to see if someone has done so.

If you was to try an older version of the installer, I can provide a link to past releases. They all, including the current version, need some additional tweaks to work on Ubuntu 20, for example FAHControl depends on Python 2.7 and installing the legacy support will allow it to function. There are a number of topics here and elsewhere on the other changes needed to get going on 20 as compared to versions 16.04 and 18.04.

You mentioned web access to control and monitor the client running, that is just a web page that can be opened in any browser. I have not done a linux install for a couple of years, but the Windows and OS X installs include placing a shortcut to https://client.foldingathome.org/.

When FAHClient is running you should be able to use telnet or similar program to connect to 127.0.0.1:36330. That port is also used by FAHControl and third party apps using a defined API for accessing the client.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
vincewebb
Posts: 3
Joined: Sat Dec 05, 2020 8:07 pm
Location: Buenos Aires

Re: Why my time as a donor was only a few hours

Post by vincewebb »

I'm going to hazard a wild guess here, perhaps someone can tell me how far off the mark I am.

From what people have said, it sounds like installation on Linux worked OK back in the days when Linux distributions still used the old "init" system start mechanism.
Having installed version 7.6.21 I can see it installed an old init start script:
/etc/init.d/FAHClient

If more effort had gone into re-writing the FAHClient install to make it use systemd instead of init then perhaps it would run correctly as "fahclient" and not "root".

I suspect that potential new donors contemplate installation within minutes of hearing about Folding@Home, in other words prior to any build up of trust in FAH. As things stand, any trust is thrown down the toilet by running the client as root.

Since the investment of effort in systemd doesn't appear to have happened, perhaps it is not too late to suggest a different tack.

How about re-packaging the Linux FAHClient to run as a Snap or a FlatPak (preferably a Snap). Either of these solutions would enable a potential donor to install FAH without any need to worry about whether they can trust the FAH software. It would also provide a mechanism for installation across a multitude of different Linux distributions.
Joe_H
Site Admin
Posts: 7875
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: Why my time as a donor was only a few hours

Post by Joe_H »

You are not too far off the mark. Part of the current lack of support for the change from use of init.d relates to the history of the F@h project.

F@h started out of Dr Pande's lab at Stanford about 20 years ago. About 10 years ago they were able to carve out enough funds to hire a single software developer to handle the client and server software for all 3 OSs supported, and that is still the situation now. About 4-5 years ago Dr Pande took a job in private industry, but maintained heading his lab until all grad students and post docs finished their degrees and research. Starting about 3 years ago much of the developers time was spent moving the server infrastructure from being based on servers at Stanford to cloud services and ones at the main remaining labs involved with F@h.

Starting last year the developer was tasked with getting the client and server code ready to be open source so more people could volunteer to work on it. That was only partly completed earlier this year, then resources were shifted to working on COVID-19 and getting more servers in place and managing the volunteered contributions of equipment and software development help. Eventually this should get al of the updates out to meet current needs, but it does take time.

One of the items to come out of the donated help are docker containers for running F@h - https://hub.docker.com/r/foldingathome/fah-gpu. Another is a VMWare appliance for running F@h - https://flings.vmware.com/vmware-applia ... lding-home. These links are available on the download page as well. There may be other packaging like this in the works, that would be discussed on the Discord developer channel. I don't follow that, my volunteer time is spent here on the forum providing support and keeping it running as well as possible.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
floyd
Posts: 5
Joined: Sun Dec 06, 2020 2:00 pm

Re: Why my time as a donor was only a few hours

Post by floyd »

The installation being OK or not really depends on your expectations. The client is still started by the old /etc/init.d/FAHClient script just the way it used to be, only the mechanism calling it is different. That means the client is initially started by root and should drop privileges ASAP, which obviously is "not OK" to you. Whether this approach is only to make the script portable between distributions or out of technical necessity I can't judge. It shouldn't be too hard to create a systemd service resembling the init script but including "User=fahclient" which seems to be what you're after. With some experience you could do it yourself. IMO the difficult part could be to automatically install one or the other depending on your local setup. Perhaps it's time to drop SysV startup or outsource it to an optional package.

As to Snap or FlatPak, I never had need for the latter and had never heard about the former before. I'm perfectly happy installing the client from a single .deb package with next to no dependencies using my usual tool and uninstalling it just as easily. I certainly would be very reluctant about adding an extra layer just for a single service. And you need to remember what audience you're addressing. Such setup would likely be too complex for many.
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Why my time as a donor was only a few hours

Post by bruce »

One other fact: Linux has lots of adherents, and many of them keep updating their systems to the latest distro but many adherents believe that the perpetual upgrade cycle supported by Windows may be a good business model for Microsoft but it doesn't fit the linux world. Shouldn't I be able to keep upgrading the FAH software without losing support on my long-term-support version of Linux? Somehow the newer distros need to maintain support for older versions of support packages -- and they've stopped doing that.

FAH needs backward compatibilty to support those of us who are still running Linux 18.xx or whatever. Why can't the there be support for both the old and the new Python version? Why can't the old init.* script keep working on my 3-year old distro?

And why can't FAH provide that backward compatibility with a single software developer?
(I can dream, can't I?)
ThWuensche
Posts: 80
Joined: Fri May 29, 2020 4:10 pm

Re: Why my time as a donor was only a few hours

Post by ThWuensche »

The following service script runs FAH as non-priviledged user fahclient
Still needs fahclient to be member of group video (and/or group render)

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