*solved* FAHClient service failed to start

Moderators: Site Moderators, PandeGroup

*solved* FAHClient service failed to start

Postby Hypocritus » Tue Nov 14, 2017 8:31 am

Hi all. I wanted to share this method that I just learned and tested. If it is documented somewhere, I couldn't find it. This is for Linux. If you have suggestions to improve its readability, KEEP THEM TO YOURSELF!! :eo I mean, Hypocritus' heart is squishy, so be gentle.

I often get this error:

Code: Select all
hypo@DRX:~$ sudo service FAHClient start
Job for FAHClient.service failed because the control process exited with error code. See "systemctl status FAHClient.service" and "journalctl -xe" for details.

However in my case the above error is usually "phantom", and the service really does start; it's just basically saying that the start wasn't clean. This usually occurs after I have had to force-kill the client
kill `pidof FAHClient` (command usually issued 3 times in a row on Linux) for a variety of reasons, such as cleaning up the trails of deleted (then recreated) stuck "Download" slots, or other reasons.

Occasionally there are times when the above error message really means that FAHClient "failed to start" and something manual has to be done. This might occur, for example, after a sudden power outage. I hate to lose work, but In the past, the surest solution I have come upon to get working again was to purge the entire client (+ work):

1) sudo apt purge fahclient or
2) to delete everything in /var/lib/fahclient and /etc/fahclient
sudo rm -r /var/lib/fahclient; sudo rm -r /etc/fahclient

and then reinstall the ... client.

(Sudden power outages may happen under any number of circumstances, to any number of people, and advising to "get a UPS" is ... almost good advice ....) In today's example, a Power: Watchdog function was enabled in the BIOS, it didn't Watchdog the Power correctly, and the short :roll: is that I was about to lose 10 GPUs of work. I followed the suggested commands:

Code: Select all
Job for FAHClient.service failed because the control process exited with error code. See "[b]systemctl status FAHClient.service[/b]" and "[b]journalctl -xe[/b]" for details.

But it was all general error messages. Yesterday I lost a whole 9-GPU machine's worth of WUs by just giving up and starting over. Today (not a regular occurrence) I was about to lose id10t :oops:

TL;DR

My /etc/fahclient/config.xml was corrupted somehow. But you cannot tell that by looking at it! Everything looks great! I did not have success by trying to edit and reuse my "existing" config.xml file. I was successful by "replacing" it with a new, edited file or a backup from the /var/lib/fahclient/configs/ folder. In my case, one of these two methods will usually get me going

1) short version) Replace your existing /etc/fahclient/config.xml file with one of the backups located in the /var/lib/fahclient/configs/ folder.
1) longer version) There are backup config.xml's locate in the /var/lib/fahclient/configs/ folder. These are usually created after any change you make in FAHControl using the "Configure" button. Find one that has the desired present configuration, or just edit it to your desired configuration (If unsure, just use your current /etc/fahclient/config.xml file as a template, but don't copy/paste the old <!-- Folding Slots --> section; type it instead. YMMV but I did not have success trying to copy and use my old <! --Folding Slots-- > section). Rename your /etc/fahclient/config.xml to something like /etc/fahclient/bak.config.xml, then copy the desired backup from the /var/lib/fahclient/configs/ folder to the /etc/fahclient/ folder. You'll have to rename that copied config file as "config.xml" Now, before you try to start the client again, review your new config.xml file to make sure the syntax is as you want it. Then,

Code: Select all
sudo service FAHClient start

OR you can try

2a) ( Caution: if your CPU/GPU Folding Slots are not correctly auto-detectable by this version of FAHClient, this method can cause your existing WUs to be scrapped and/or returned incomplete. The good news is that it will use the GPUs.txt that it sees, or download the latest version before detecting...)

From the /var/lib/fahclient folder, type sudo FAHClient

Code: Select all
cd /var/lib/fahclient
sudo FAHClient

What this does is it bypasses the regular FAHClient installed service with its /etc/fahclient/config.xml file, and starts FAHClient fresh in the directory that you run it from. It will see all necessary components in that directory to run EXCEPT a config.xml, which it will create. If your folding clients (CPU/GPU) are auto-detectable by FAHClient, all of your work should be preserved. You'll then need to shut down that client (Ctrl-C in the command prompt window), and edit that new config.xml file, splicing in any additional data like your passkey, etc. Using the same command just given, start FAHClient again to verify that all the info your new config.xml is arrayed correctly. Shut down that client (Ctrl-C in command window). Now rename the old /etc/fahclient/config.xml to something like /etc/fahclient/bak.config.xml . Now copy your new /var/lib/fahclient/config.xml file to the /etc/fahclient/ folder.

OR (this one doesn't depend on auto-detect)

2b) A variation of the last method is to a) copy one of the desirable config.xml backups from /varlib/fahclient/configs/ to /var/lib/fahclient/; b) edit it as desired; c) rename it as config.xml if you haven't already done so; d) run sudo FAHClient from the /var/lib/fahclient folder Command line; e) Verify everything is as you want it; f) Ctrl-C from the command window to quit the client; g) Copy this new /var/lib/fahclient/config.xml file to the /etc/fahclient/ folder; h) Start the FAHClient service as normal.

Again YMMV but I did not have success trying to edit or use my existing /etc/fahclient/config.xml, nor copying and trying to use the old <! --Folding Slots-- > section from that (apparently corrupted) file.
Hypocritus
 
Posts: 9
Joined: Sat Jan 30, 2010 2:38 am

Re: *solved* FAHClient service failed to start

Postby bruce » Wed Nov 15, 2017 3:23 am

Thanks for a detailed explanation. In fact, I've seen the equivalent issue crop up on Windows and MacOS, though the description would be quite different.

Another way of stating your problem is to note that FAHClient is totally intolerant of syntactical errors in config.xml.

That's the reason why we strongly caution against manually editing the .xml file. We recommend that all changes be done with FAHControl which contains a reliable (and thoroughly debugged) editor for config.xml.

Your suggestion to revert to a previously functioning config from the backups is an excellent way to restore a functioning client.
bruce
 
Posts: 21407
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.


Return to V7.4.4 Public Release Windows/Linux/MacOS X

Who is online

Users browsing this forum: No registered users and 1 guest

cron