Add our beta PPA to get the latest updates to the landscape-client package
sudo add-apt-repository ppa:landscape/self-hosted-beta# 1. Install our signing key
gpg --keyserver keyserver.ubuntu.com --recv-keys 6e85a86e4652b4e6
gpg --export 6e85a86e4652b4e6 | sudo tee -a /usr/share/keyrings/landscape-client-keyring.gpg > /dev/null
# 2. Add repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/landscape-client-keyring.gpg] https://ppa.launchpadcontent.net/landscape/self-hosted-beta/ubuntu focal main" | sudo tee -a /etc/apt/sources.list.d/landscape-client.listsudo apt update && sudo apt install landscape-clientThe Landscape Client generally runs as a combination of the root and
landscape users. It is possible to disable the administrative features of
Landscape and run only the monitoring parts without using the root user at
all.
If you wish to use the Landscape Client in this way, it's recommended that you perform these steps immediately after installing the landscape-client package.
Edit /etc/default/landscape-client and add the following lines:
RUN=1
DAEMON_USER=landscape
Edit /etc/landscape/client.conf and add the following line:
monitor_only = true
Now you can complete the configuration of your client and register with the Landscape service. There are two ways to do this:
sudo landscape-configand answer interactive prompts to finalize your configurationsudo landscape-config --account-name standalone --url https://<server>/message-system --ping-url http://<server>/pingif registering to a self-hosted Landscape instance. Replace<server>with the hostname of your self-hosted Landscape instance.
After cloning the repository, make sure you run the following command to pull the snap-http submodule:
git submodule update --initTo run the full test suite, run the following command:
make checkWhen you want to test the landscape client manually without management features, you can simply run:
./scripts/landscape-clientThis defaults to the landscape-client.conf configuration file.
When you want to test management features manually, you'll need to run as root.
There's a configuration file root-client.conf which specifies use of the
system bus.
sudo ./scripts/landscape-client -c root-client.confBefore opening a PR, make sure to run the full test suite and lint:
make check
make lintYou can run a specific test by running the following (for example):
python3 -m twisted.trial landscape.client.broker.tests.test_client.BrokerClientTest.test_pingFirst, you need to ensure that you have the appropriate tools installed:
sudo snap install snapcraft --classic
lxd init --autoThere are various make targets defined to assist in the lifecycle of
building and testing the snap. To generate the snap's snapcraft.yaml file:
make snap-yamlTo simply build the snap with the minimum of debug information displayed:
make snapIf you would prefer to see more information displayed showing the progress of the build, and would like to get dropped into a debug shell within the snap container in the event of an error:
make snap-debugTo use the make targets below, make sure you have yq installed. You can install it using Homebrew or as a snap:
brew install yq
snap install yqTo install the resulting snap:
make snap-installTo remove a previously installed snap:
make snap-removeTo clean the intermediate files as well as the snap itself from the local build environment:
make snap-cleanTo enter into a shell environment within the snap container:
make snap-shellIf you wish to upload the snap to the store, you will first need to get credentials with the store that allow you to log in locally and publish binaries. This can be done at:
https://snapcraft.io/docs/creating-your-developer-account
After obtaining and confirming your store credentials, you then need to log in using the snapcraft tool:
snapcraft loginSince snapcraft version 7.x and higher, the credentials are stored in the gnome keyring on your local workstation. If you are building in an environment without a GUI (e.g. in a multipass or lxc container), you will need to install the gnome keyring tools:
sudo apt install gnome-keyringYou will then need to initialze the default keyring as follows:
dbus-run-session -- bash
gnome-keyring-daemon --unlockThe gnome-keyring-daemon will prompt you (without a prompt) to type in the initial unlock password (typically the same password for the account you are using - if you are using the default multipass or lxc "ubuntu" login, use sudo passwd ubuntu to set it to a known value before doing the above step).
Type the login password and hit followed by +D to end the input.
At this point, you should be able to log into snapcraft:
snapcraft loginYou will be prompted for your UbuntuOne email address, password and, if set up this way, your second factor for authentication. If you are successful, you should be able to query your login credentials with:
snapcraft whoamiA common mistake that first-time users of this process might make is that after running the gnome-keyring-daemon command, they will exit the dbus session shell. Do NOT do that. Do all subsequent work in that bash shell that dbus set up for you because it will have access to your gnome-keyring.
If you need to leave the environment and get back in, keep in mind that you do not have to be logged into the store UNLESS you are uploading the snap or otherwise manipulating things in your store account. You will need to repeat the dbus-run-session and gnome-keyring-daemon steps BEFORE logging in if you do need to be logged into the store.
The landscape-client snap is automatically built from the most recent commit on the release branches and published to the <base>/edge channel of the respective core base:
| Core Base | Edge Channel | Build Recipe |
|---|---|---|
| 24 | 24/edge |
core-24 |
| 22 | 22/edge |
core-22 |
Other channels (<base>/beta, <base>/candidate, <base>/stable) are promoted and released manually.