Page 1 of 1

[ubuntu server 20.04] systemctl issue

Posted: Sat Apr 25, 2020 9:19 pm
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.

Re: [ubuntu server 20.04] systemctl issue

Posted: Mon Nov 09, 2020 1:54 am
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.

Re: [ubuntu server 20.04] systemctl issue

Posted: Mon Nov 09, 2020 3:14 am
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?

Re: [ubuntu server 20.04] systemctl issue

Posted: Mon Nov 09, 2020 3:58 am
by bruce

Re: [ubuntu server 20.04] systemctl issue

Posted: Fri Nov 13, 2020 1:48 am
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$

Re: [ubuntu server 20.04] systemctl issue

Posted: Fri Nov 13, 2020 6:14 am
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.

Re: [ubuntu server 20.04] systemctl issue

Posted: Tue Nov 17, 2020 2:17 am
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!