Problem with thin-edge install.sh with tarball

Product/components used and version/fix level:

tedge v1.0.1

Detailed explanation of the problem:

After success getting thin-edge client installed and running on a Debian buster VM, I am now working to get it running on a BeagleBone Black running a Debian buster subset. We do not have a working apt in this image, so I downloaded the install.sh script and am running it with install.sh --package-manager tarball. I have already installed mosquitto and ca-certificates (and all the packages on which they depend). I made one change to install.sh so it won’t blindly try to run apt to install ca-certificates. Running apt results in an error.

After all this I got the install script to run without error. However, the services are not registered, and so they do not get launched when I try to connect to the cloud. Running systemctl list-unit-files | grep tedge shows nothing. If it do this on my Debian VM it shows the service files.

I examined the tarball_postinstall() function in the install.sh file and don’t see anything that would register these services. Any help would be appreciated.

Error messages / full error message screenshot / log file:

Question related to a free trial, or to a production (customer) instance?

This is related to a production instance (developing a new product to integrate with existing line).

Hi @RogerCUSAFW

I don’t know what exactly you changed in install.sh. However, running tedge connect c8y should enable and start the two main services, aka tedge-agent and tedge-mapper-c8y. What’s the behavior of tedge connect c8y on the device installed from a tarball?

Here is what I get when I connect:

root@device:~# tedge connect c8y
The system config file '/etc/tedge/system.toml' doesn't exist. Use '/bin/systemctl' as a service manager.

Detected mosquitto version < 2.0.0
Checking if systemd is available.

Checking if configuration for requested bridge already exists.

Validating the bridge certificates.

Creating the device in Cumulocity cloud.

Saving configuration for requested bridge.

Restarting mosquitto service.

Awaiting mosquitto to start. This may take up to 5 seconds.

Enabling mosquitto service on reboots.

Successfully created bridge connection!

Sending packets to check connection. This may take up to 2 seconds.

Connection check is successful.

Checking if tedge-mapper is installed.

Starting tedge-mapper-c8y service.

Failed to stop tedge-mapper-c8y service: ServiceCommandFailedWithCode { service_command: "/bin/systemctl start tedge-mapper-c8y", code: 5 }
Persisting tedge-mapper-c8y on reboot.

Failed to enable tedge-mapper-c8y service: ServiceCommandFailedWithCode { service_command: "/bin/systemctl enable tedge-mapper-c8y", code: 1 }
Warning: Connecting to dashboard.hennypenny.com, but the configured URL is t517788845.us.cumulocity.com.
The device certificate has to be removed from the former tenant.

Enabling software management.

Checking if tedge-agent is installed.

Starting tedge-agent service.

Failed to stop tedge-agent service: ServiceCommandFailedWithCode { service_command: "/bin/systemctl start tedge-agent", code: 5 }
Persisting tedge-agent on reboot.

Failed to enable tedge-agent service: ServiceCommandFailedWithCode { service_command: "/bin/systemctl enable tedge-agent", code: 1 }
root@device:~#

And here is what I changed in install.sh:

*** install.sh	2024-04-08 10:42:19.178491133 -0400
--- installBBB.sh	2024-04-08 10:40:58.947400048 -0400
***************
*** 573,579 ****
              if command_exists mosquitto; then
                  # Note: mosquitto could either be manually installed (e.g. in a container) and not via a package manager
                  # so don't install mosquitto if the binary exists
!                 try_install_dependencies $PREDEPENDS_PACKAGES
              else
                  try_install_dependencies mosquitto $PREDEPENDS_PACKAGES
              fi
--- 573,580 ----
              if command_exists mosquitto; then
                  # Note: mosquitto could either be manually installed (e.g. in a container) and not via a package manager
                  # so don't install mosquitto if the binary exists
!                 #try_install_dependencies $PREDEPENDS_PACKAGES
!                 echo Skipping try_install_dependencies $PREDEPENDS_PACKAGES
              else
                  try_install_dependencies mosquitto $PREDEPENDS_PACKAGES
              fi

The tarball package manager only installs the binaries, it does not install any systemd services! Generally you should only use the tarball option if you just want the binaries and you will be looking after running the binaries yourself (e.g. when using within a container or using the https://thin-edge.io/install-services.sh script to install some other non-systemd service manager definitions). That is why the systemd commands are failing as there is no tedge* services installed.

Though what the reasoning behind selecting the tarball option in the first place? Is there an unwanted package dependency?

I chose tarball because our apt was not working. I decided to get that fixed so I could just use the default apt install method. This is working now.