/etc/init.d/FAHClient stop does not work

Moderators: Site Moderators, FAHC Science Team

Post Reply
lleb
Posts: 36
Joined: Mon Aug 03, 2009 8:18 pm

/etc/init.d/FAHClient stop does not work

Post by lleb »

Fresh install of Ubuntu 20.x running most current vs of F@H, sadly the newer versions of Ubuntu are not compatible with the GUI control for F@H so Im stuck working with CLI only. Not a major issue if it would behave and follow basic commands.

Running htop to monitor my system

# ps -e | grep FAH*
1367 ? 00:00:12 FAHClient
1393 ? 00:00:55 FAHClient
65134 ? 00:00:00 FAHCoreWrapper

FAHCoreWrapper and others continue to run. Even with F9 issued via htop multiple times it still continues to return without the start command. This is not acceptable behavior for any linux program. Start when told to start, stop when told to stop. FAHCore is not stopping.

What information do you need to help you help me.

edit to add

Code: Select all

-rw-rw-r--  1 user user 3266064 Nov 14 15:06 fahclient_7.6.21_amd64.deb
-rw-rw-r--  1 user user  145292 Nov 14 15:06 fahcontrol_7.6.21-1_all.deb
-rw-rw-r--  1 user user 4664692 Nov 14 15:06 fahviewer_7.6.21_amd64.deb
just wanted to add those as they were just downloaded and used the CLI installation process:

https://foldingathome.org/faqs/installa ... nt-ubuntu/
gunnarre
Posts: 567
Joined: Sun May 24, 2020 7:23 pm
Location: Norway

Re: /etc/init.d/FAHClient stop does not work

Post by gunnarre »

If you keep killing the core process, I suspect that the client will re-launch it because it thinks the core failed.

Try to run the command ""FAHClient --send-pause"" and/or "sudo killall FAHClient" and wait a few seconds for it stop. If you have a web browser, visit "http://client.foldingathome.org" to control the client via the localhost web interface.

As you found out, Ubuntu 20 isn't officially supported, but it's possible to make a better start-up script that plays well with Ubuntu 20:
viewtopic.php?f=81&t=33353#p318278
TL;DR For the users: To work around this, I created a systemd unit to start FAHClient instead of the init.d script. This works by using the systemd unit's "User" option to change users instead of having FAHClient do it.

First, stop FAHClient ("sudo systemctl stop FAHClient").

Create /etc/systemd/system/FAHClient.service (The name matters; calling it this will automatically supersede the init.d script of the same name), with the following contents:

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 do the following:

Code: Select all

sudo systemctl daemon-reload
sudo systemctl start FAHClient.service
# And, if you want it to start automatically on boot...
sudo systemctl enable FAHClient.service
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
lleb
Posts: 36
Joined: Mon Aug 03, 2009 8:18 pm

Re: /etc/init.d/FAHClient stop does not work

Post by lleb »

Fantastic. Thank you very much for the help and direction.
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: /etc/init.d/FAHClient stop does not work

Post by bruce »

lleb wrote:# ps -e | grep FAH*
1367 ? 00:00:12 FAHClient
1393 ? 00:00:55 FAHClient
65134 ? 00:00:00 FAHCoreWrapper
There never should be two copies of FAHClient running. I suspect this is the result of a bug somewhere but it might have been something you did. I had the same sort of thing happen on a WIndows system in the past it it was a bit of a challenge to fix it. If that's where you end up again we can discuss it and dig down until we figure it out.
Post Reply