Comment 7 for bug 1868730

Revision history for this message
Alan Baghumian (alanbach) wrote :

Hello there,

I just had to go through this issue, was this ever released?

$ sudo landscape-config --computer-title $(hostname) --account-name standalone -p <token> --url https://lds.int.hrizn.cloud/message-system --ping-url http://lds.int.hrizn.cloud/ping
enabled

This script will interactively set up the Landscape client. It will
ask you a few questions about this computer and your Landscape
account, and will submit that information to the Landscape server.
After this computer is registered it will need to be approved by an
account administrator on the pending computers page.

Please see https://landscape.canonical.com for more information.

The Landscape client communicates with the server over HTTP and
HTTPS. If your network requires you to use a proxy to access HTTP
and/or HTTPS web sites, please provide the address of these
proxies now. If you don't use a proxy, leave these fields empty.

HTTP proxy URL:
HTTPS proxy URL:

Landscape has a feature which enables administrators to run
arbitrary scripts on machines under their control. By default this
feature is disabled in the client, disallowing any arbitrary script
execution. If enabled, the set of users that scripts may run as is
also configurable.

Enable script execution? [y/N]:

You may provide an access group for this computer e.g. webservers.

Access group:

You may provide tags for this computer e.g. server,precise.

Tags [vstack,jammy]:
Please wait...

Request a new registration for this computer now? [Y/n]: y
Traceback (most recent call last):
Failure: twisted.internet.error.ConnectError: An error occurred while connecting: 2: No such file or directory.

$ sudo systemctl status landscape-client.service
○ landscape-client.service - Landscape client daemons
     Loaded: loaded (/lib/systemd/system/landscape-client.service; enabled; vendor preset: enabled)
     Active: inactive (dead) (Result: exec-condition) since Sat 2023-09-23 19:02:42 UTC; 2min 55s ago
  Condition: start condition failed at Sat 2023-09-23 19:02:42 UTC; 2min 55s ago
       Docs: man:landscape-client(1)
             man:landscape-config(1)
    Process: 12314 ExecCondition=/usr/bin/landscape-config --is-registered (code=exited, status=5)
        CPU: 279ms

Sep 23 19:02:42 juju-b096f0-92-lxd-0 systemd[1]: Starting Landscape client daemons...
Sep 23 19:02:42 juju-b096f0-92-lxd-0 landscape-config[12314]: Registered: False
Sep 23 19:02:42 juju-b096f0-92-lxd-0 landscape-config[12314]: Config Path: /etc/landscape/client.conf
Sep 23 19:02:42 juju-b096f0-92-lxd-0 landscape-config[12314]: Data Path /var/lib/landscape/client
Sep 23 19:02:42 juju-b096f0-92-lxd-0 systemd[1]: landscape-client.service: Skipped due to 'exec-condition'.
Sep 23 19:02:42 juju-b096f0-92-lxd-0 systemd[1]: Condition check resulted in Landscape client daemons being skipped.

ubuntu@juju-b096f0-92-lxd-0:~$ /usr/bin/landscape-config --is-registered

Registered: False
Config Path: /etc/landscape/client.conf
Data Path /var/lib/landscape/client

ubuntu@juju-b096f0-92-lxd-0:~$ echo $?
5

ubuntu@juju-b096f0-92-lxd-0:~$ dpkg -l | grep landscape
ii landscape-client 23.02-0ubuntu1~22.04.1 amd64 Landscape administration system client
ii landscape-common 23.02-0ubuntu1~22.04.1 amd64 Landscape administration system client - Common files

What worked was running the client then performing the registration:

ubuntu@juju-b096f0-92-lxd-0:~$ sudo /usr/bin/python3 /usr/bin/landscape-client &
[1] 12686

Then killed the PID and restarted the service normally:

ubuntu@juju-b096f0-92-lxd-0:~$ sudo systemctl restart landscape-client.service
ubuntu@juju-b096f0-92-lxd-0:~$ sudo systemctl status landscape-client.service
● landscape-client.service - Landscape client daemons
     Loaded: loaded (/lib/systemd/system/landscape-client.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-09-23 19:14:25 UTC; 2s ago
       Docs: man:landscape-client(1)
             man:landscape-config(1)
    Process: 13742 ExecCondition=/usr/bin/landscape-config --is-registered (code=exited, status=0/SUCCESS)
   Main PID: 13743 (landscape-clien)
      Tasks: 6 (limit: 314572)
     Memory: 198.0M
        CPU: 2.692s
     CGroup: /system.slice/landscape-client.service
             ├─13743 /usr/bin/python3 /usr/bin/landscape-client
             ├─13744 /usr/bin/python3 /usr/bin/landscape-broker --ignore-sigint
             ├─13745 /usr/bin/python3 /usr/bin/landscape-monitor --ignore-sigint
             ├─13746 /usr/bin/python3 /usr/bin/landscape-manager --ignore-sigint
             ├─13749 /usr/bin/python3 /usr/bin/landscape-package-reporter --quiet
             └─13754 /usr/bin/apt-get -q update

Sep 23 19:14:25 juju-b096f0-92-lxd-0 systemd[1]: Starting Landscape client daemons...
Sep 23 19:14:25 juju-b096f0-92-lxd-0 landscape-config[13742]: Registered: True
Sep 23 19:14:25 juju-b096f0-92-lxd-0 landscape-config[13742]: Config Path: /etc/landscape/client.conf
Sep 23 19:14:25 juju-b096f0-92-lxd-0 landscape-config[13742]: Data Path /var/lib/landscape/client
Sep 23 19:14:25 juju-b096f0-92-lxd-0 landscape-config[13742]: Account Name: standalone
Sep 23 19:14:25 juju-b096f0-92-lxd-0 systemd[1]: Started Landscape client daemons.
Sep 23 19:14:26 juju-b096f0-92-lxd-0 landscape-client[13743]: 2023-09-23 19:14:26,409 INFO [MainThread] Watchdog watching for daemons.

Please let me know if you need more details / logs etc.

Best,
Alan