[ubuntu server 20.04] systemctl issue

Moderators: Site Moderators, FAHC Science Team

Post Reply
gadolf
Posts: 20
Joined: Wed Apr 22, 2020 2:32 pm

[ubuntu server 20.04] systemctl issue

Post by gadolf »

Hi,
I just came from installing f@h client on a ubuntu server 20.04, but there is an issue with systemctl (see below).
top shows the client is running.
Is there anything I should do to get systemctl handle f@h client as a service?

Code: Select all

gustavo@srv:~$ sudo tail -f /var/log/syslog
Apr 25 21:08:13 srv systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
Apr 25 21:08:14 srv systemd[1]: Reloading.
Apr 25 21:08:14 srv systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
Apr 25 21:08:15 srv systemd[1]: Starting LSB: Folding@home Client...
Apr 25 21:08:15 srv FAHClient[21254]: Starting fahclient ... FAIL
Apr 25 21:08:15 srv systemd[1]: FAHClient.service: Control process exited, code=exited, status=1/FAILURE
Apr 25 21:08:15 srv systemd[1]: FAHClient.service: Failed with result 'exit-code'.
Apr 25 21:08:15 srv systemd[1]: Failed to start LSB: Folding@home Client.
Apr 25 21:08:15 srv systemd[1]: Reloading.
Apr 25 21:08:15 srv systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
Apr 25 21:09:01 srv CRON[21342]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
^C
gustavo@srv:~$ sudo systemctl status FAHClient
● FAHClient.service - LSB: Folding@home Client
     Loaded: loaded (/etc/init.d/FAHClient; generated)
     Active: failed (Result: exit-code) since Sat 2020-04-25 18:08:15 -03; 1min 31s ago
       Docs: man:systemd-sysv-generator(8)
      Tasks: 16 (limit: 4494)
     Memory: 112.7M
     CGroup: /system.slice/FAHClient.service
             ├─21263 /usr/bin/FAHClient /etc/fahclient/config.xml --run-as fahclient --pid-file=/var/run/fahclient.pid --daemon
             ├─21265 /usr/bin/FAHClient --child /etc/fahclient/config.xml --run-as fahclient --pid-file=/var/run/fahclient.pid --daemon
             ├─21331 /usr/bin/FAHCoreWrapper /var/lib/fahclient/cores/cores.foldingathome.org/v7/lin/64bit/Core_a7.fah/FahCore_a7 -dir 00 -suffix 01>
             └─21335 /var/lib/fahclient/cores/cores.foldingathome.org/v7/lin/64bit/Core_a7.fah/FahCore_a7 -dir 00 -suffix 01 -version 706 -lifeline >

Apr 25 18:08:15 srv systemd[1]: Starting LSB: Folding@home Client...
Apr 25 18:08:15 srv FAHClient[21254]: Starting fahclient ... FAIL
Apr 25 18:08:15 srv systemd[1]: FAHClient.service: Control process exited, code=exited, status=1/FAILURE
Apr 25 18:08:15 srv systemd[1]: FAHClient.service: Failed with result 'exit-code'.
Apr 25 18:08:15 srv systemd[1]: Failed to start LSB: Folding@home Client.
HendricksSA
Posts: 336
Joined: Fri Jun 26, 2009 4:34 am

Re: [ubuntu server 20.04] systemctl issue

Post by HendricksSA »

I too am having problems with v21 and Ubuntu 20. I have installed the 7.6.21 client four times and while the installs are a little different each time, the result is the same. After an install, v21 prompts for the username, password, team, and power setting (I always select "full"). Then about a minute passes and the client begins running. I process normally until I restart my computer. After the restart, I find that the client is not running. Does not matter whether I log in as admin or standard user. I had NO problems with 7.6.13 and Ubuntu 18. Unfortunately, I violated the cardinal rule of changing two things at once - new OS and new client. Below is the error I see. Does anyone have any advice/suggestions? I have not tried to fall back to v13 but that is certainly an option. Thanks for any help.

Code: Select all

● FAHClient.service - LSB: Folding@home Client
     Loaded: loaded (/etc/init.d/FAHClient; generated)
     Active: failed (Result: exit-code) since Sun 2020-11-08 16:30:51 CST; 18min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1872 ExecStart=/etc/init.d/FAHClient start (code=exited, status=1/FAILURE)

Nov 08 16:30:50 coffeeserver systemd[1]: Starting LSB: Folding@home Client...
Nov 08 16:30:51 coffeeserver FAHClient[1872]: Starting fahclient ... FAIL
Nov 08 16:30:51 coffeeserver systemd[1]: FAHClient.service: Control process exited, code=exited, status=1/FAILURE
Nov 08 16:30:51 coffeeserver systemd[1]: FAHClient.service: Failed with result 'exit-code'.
Nov 08 16:30:51 coffeeserver systemd[1]: Failed to start LSB: Folding@home Client.
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: [ubuntu server 20.04] systemctl issue

Post by bruce »

The Linux installation script should install a script that starts FAHClient as a background daemon when you reboot. The installation also should create a unique user ID (probably "FAHClient") with just the permissions to run the daemon and access FAH's working files. The installation script also starts the Daemon and apparently that is working. The script that restarts the daemon after a reboot should do exactly the same thing and apparently it is not. Please confirm that FAHClient is/is_not running after a reboot.

When a new distro of Linux is distributed, they do sometimes change how the reboot script (/etc/init.d/FAHClient) needs to be installed and/or updated. I'm not enough of a Linux guru to know how 20.04 does it an why it isn't working for you but at least that's something that can be researched. What happens if you run that script manually?
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: [ubuntu server 20.04] systemctl issue

Post by bruce »

HendricksSA
Posts: 336
Joined: Fri Jun 26, 2009 4:34 am

Re: [ubuntu server 20.04] systemctl issue

Post by HendricksSA »

Bruce, I can verify that FAHClient is not running after a reboot. When I run the reboot script I see the following errors. If there is an error in my config.xml I can't see it. This is the same file I used with 7.6.13 with the exception of the <fold-anon> line. Hopefully I have captured enough of the essentials to help someone offer a solution. It certainly has me puzzled ... and no, I have not fallen back to 7.6.13 yet. If someone way smarter than me has no suggestions, I will try to locate and reinstall v13 this weekend. Errors:

Code: Select all

steven@coffeeserver:~$ cd /etc/fahclient
steven@coffeeserver:/etc/fahclient$ ls -la
total 24
drwxrwxr-x   2 fahclient root  4096 Nov 11 16:51 .
drwxr-xr-x 148 root      root 12288 Nov 12 17:24 ..
-rw-r--r--   1 fahclient root   330 Nov 11 16:51 config.orig
-rw-r--r--   1 fahclient root   512 Nov 11 16:53 config.xml

steven@coffeeserver:/etc/fahclient$ sudo /etc/init.d/FAHClient start -v
[sudo] password for steven:
Starting fahclient ... 01:04:20:ERROR:Exception: Parse failed: 7: mismatched tag
01:04:20:ERROR:       At: /etc/fahclient/config.xml:24:4
FAIL

steven@coffeeserver:/etc/fahclient$ sudo /etc/init.d/FAHClient restart -v
Starting fahclient ... 01:05:11:ERROR:Exception: Parse failed: 7: mismatched tag
01:05:11:ERROR:       At: /etc/fahclient/config.xml:24:4
FAIL

steven@coffeeserver:/etc/fahclient$ sudo /etc/init.d/FAHClient reload -v
Reloading fahclient ... cat: /var/run/fahclient.pid: No such file or directory
FAIL

steven@coffeeserver:/etc/fahclient$ cat config.xml
<config>
  <!-- Client Control -->
  <fold-anon v='true'/>
  <client-type v='advanced'/>
  <max-packet-size v='big'/>

  <!-- Folding Slot Configuration -->
  <gpu v='false'/>

  <!-- Slot Control -->
  <power v='full'/>
  <pause-on-start v='true'/>

  <!-- User Information -->
  <passkey v='xxx'/>
  <user v='xxx'/>

  <!-- Work Unit Control -->
  <next-unit-percentage v='100'/>

  <!-- Folding Slots -->
  <slot id='0' type='CPU'/>
    <cpus v='48'/>
  </slot>
</config>
steven@coffeeserver:/etc/fahclient$
Whompithian
Posts: 39
Joined: Thu Jun 25, 2020 12:40 am

Re: [ubuntu server 20.04] systemctl issue

Post by Whompithian »

HendricksSA wrote:

Code: Select all

Starting fahclient ... 01:04:20:ERROR:Exception: Parse failed: 7: mismatched tag
01:04:20:ERROR:       At: /etc/fahclient/config.xml:24:4
That reports that there is an error in config.xml:
HendricksSA wrote:

Code: Select all

  <!-- Folding Slots -->
  <slot id='0' type='CPU'/>
    <cpus v='48'/>
  </slot>
</config>
The slot tag is closed out on the same line it is defined, then the separate </slot> closing tag has no match.
HendricksSA wrote:

Code: Select all

● FAHClient.service - LSB: Folding@home Client
     Loaded: loaded (/etc/init.d/FAHClient; generated)
Also, I recommend against relying on the automagic translation from init.d to systemd for the init script. There is some good advice on working around this in another post:

viewtopic.php?f=81&t=33353#p318278

Look under the "TL;DR" heading. The best way to create the unit file is to issue:

Code: Select all

sudo systemctl edit --force --full FAHClient.service
Then, fill out and save the file as directed in that post. You may want to modify, e.g. RuntimeDirectory and WorkingDirectory to use absolute paths.
HendricksSA
Posts: 336
Joined: Fri Jun 26, 2009 4:34 am

Re: [ubuntu server 20.04] systemctl issue

Post by HendricksSA »

Whompithian and Bruce, thanks for your help. v21 is back to running after a reboot ... finally. Turns out the startup for the client must perform a check of config.sys that failed when it hit my tag error. Once I fixed that and restarted the computer the config.sys was parsed and folding started right up. I didn't have to use systemctl to fix the init problem although both references contained valuable insights on how to do that. Under Ubuntu 20, systemctl enable relocated the init script due to its not being a part of LSB but I did not use it the second time since fixing config.sys solved the problem. Again, thanks!
Post Reply