18. Managing CLD Clients

Introduction

One of our missions is to simplify administrative tasks of a large number of systems. This guide is about a client machine with Calculate Linux Desktop on board, introduced in a CDS domain.

The "remote" network drive

Most general system resources are located in the /usr/calculate/share directory. The directories you can see there are intended for:

  • assemble - additional resources used to build the system
  • distfiles - program sources
  • linux - distributions
  • snapshots - portage trees
  • stages - stage3 image, used to compile the system
  • templates - user-defined templates

Installation templates

All Calculate Linux distributions use templates to configure the system. It is a simple and efficient method to accomodate the system to your needs. User templates are located in the directory /usr/calculate/share/profile. Using shared resources you can change settings on all computers or selectively, by adding the computer hostname in the template name.

Executing commands on the client side

A situation may arise when you need to perform certain actions on all the local network machines. For example, you may want to know who works in the system, or for how long each machine has been running without having to reboot (i.e. the uptime), how many users simultaneously logged into the session, whether there were errors during initialization of the graphical session, etc. To do this, you can use the public key generated on the server and put on the client machines in the /root directory. In this case, you get full access to the client machine from the script.

The procedure of creating a public key is described here. Do not forget about templates, which help you record the public key on users' computers.

You can write a script that will scan the network, revealing the working Linux clients. Try using the following search command:

LANG=C nmap -p111 -n -PS111 192.168.0.0/24

To run a command remotely on the client machine, the following can be used:
ssh -o 'StrictHostKeyChecking=no' root@HOST EXEC

Where HOST is the network name or IP adress of the computer and EXEC is the command.

Updates from binary packages

The big advantage of the emerge package manager is that it supports binary files: they can be built and installed as such. Fortunately, you do not need a specific version of Portage to install binaries. In fact, you can update the Portage tree on one client machine only, giving them the write access to the directory /usr/calculate/share/packages.

To separate packages that were compiled in different systems with different architectures, Calculate Linux modifies the PKGDIR variable in /etc/make.conf.

To build a binary package, execute:

emerge --buildpkg PACKAGE

where PACKAGE is the package name.

You can install a package by its full name, including the version, by using the --usepkgonly option. You do not have to update Portage on each client machine then.

You can also combine both options:

emerge -bk PACKAGE

In this case, the package will be compiled only if there is no binary package available.

Thank you!