Installation fails silently on Ubuntu 24.10 & 25.04

After creating the client on the server, I download the Linux client and, when I run it, it stops at ‘Installing systemd unit…’ without throwing an error. It’s been this way for some months, including when my systems were on 24.10 and more recently after upgraded to 25.04, but I expect it’s been like this for some time.

$ sudo ./UrBackup\ Client\ \(client-hostname\).sh 
Verifying archive integrity... All good.
Uncompressing UrBackup Client Installer for Linux  100%  
Installation of UrBackup Client 2.5.25 to /usr/local ... Proceed ? [Y/n]
y
Uncompressing install data...
Detected Debian \(derivative\) system
Detected systemd
Detected architecture x86_64-linux-glibc
Installing systemd unit...

This should throw an error, since it didn’t install anything into systemd and there are several steps that are supposed to complete after that.

This is the section that seems not to be working as expected:

        echo "Installing systemd unit..."
        SYSTEMD_DIR=""
        if command -v pkg-config >/dev/null 2>&1
        then 
                SYSTEMD_DIR=`pkg-config systemd --variable=systemdsystemunitdir`
        fi

        if [ "x$SYSTEMD_DIR" = x ]
        then
                if test -e "/lib/systemd/system/urbackupclientbackend.service"
                then
                        echo "Updating existing systemd unit at /lib/systemd/system/urbackupclientbackend.service"
                        SYSTEMD_DIR="/lib/systemd/system"
                elif test -e "/usr/lib/systemd/system"
                then
                        echo "Cannot find systemd unit dir. Assuming /usr/lib/systemd/system"
                        SYSTEMD_DIR="/usr/lib/systemd/system"
                else
                        echo "Cannot find systemd unit dir. Assuming /lib/systemd/system"
                        SYSTEMD_DIR="/lib/systemd/system"
                fi
        fi

Running the script independently with the -x flag shows:

...
+ [ yes = yes ]
+ echo Installing systemd unit...
Installing systemd unit...
+ SYSTEMD_DIR=
+ command -v pkg-config
+ pkg-config systemd --variable=systemdsystemunitdir
+ SYSTEMD_DIR=

Which would suggest that it never gets to the if [ "x$SYSTEMD_DIR" = x ] test.

On my systems:

$ command -v pkg-config
/usr/bin/pkg-config

So pkg-config is installed.

$ pkg-config systemd --variable=systemdsystemunitdir
$

So the pkg-config variable systemdsystemunitdir is empty.

However, the result from the above command is:

$ echo $?
1

This, combined with set -e at the beginning of the script means that the script will silently end, since pkg-config returns a non-zero value, which is intolerable to the -e switch.

The easiest way I can think to resolve this situation is to add || true to line 327:

           SYSTEMD_DIR=`pkg-config systemd --variable=systemdsystemunitdir || true`

That worked on my system. (Ubuntu uses dash as the default root shell). I’m unsure if that will work in all scenarios.

I’m trying to install the client on OpenMandriva Rome 25.04 and I also have a silent fail of installing the systemd unit.

I recently had this happen on Debian, and I needed to install the systemd-dev package, which provided the right information for pkg-config to return an answer. After that the install script worked.

1 Like

Thank you @JML that worked!

On OpenMandriva, the package name is

lib64systemd-devel

Would be great if someone finds out what needs changing at

urbackup_backend/install_client_linux.sh at dev · uroni/urbackup_backend · GitHub

to make it work without such issues.

When I try to modify the client bash script, I can never get it to run. I’m assuming it’s messing up the hash of the included bin files?

This is the error I get…

sudo sh 'UrBackup Client Linux 2.5.25.sh'
UrBackup Client Linux 2.5.25.sh: line 3: $'\r': command not found
: octal number out of range5.sh: line 4: umask: 077
UrBackup Client Linux 2.5.25.sh: line 5: $'\r': command not found
UrBackup Client Linux 2.5.25.sh: line 9: $'\r': command not found
UrBackup Client Linux 2.5.25.sh: line 18: $'\r': command not found
UrBackup Client Linux 2.5.25.sh: line 22: syntax error near unexpected token `elif'
'rBackup Client Linux 2.5.25.sh: line 22: `elif test -x /usr/ucb/echo; then

How would I go about testing changes, to fix the script?

Use parameters --noexec --keep to the script. Then go into the linux-installer subdir, modify the script and then run it.