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.