Technical:RemoteClientShutdown

From K12LTSP Wiki

Jump to: navigation, search

Jim McQuillan explained how you can manage LTSP 4 clients remotely:

Starting with LTSP-4.0, we've got a daemon running on the client, waiting for something to do. It's called ltspinfod. It was originally designed to answer questions about the client. For instance, the server can ask the client which sound daemon it is running, so that it knows how to setup the server-side stuff to send the sound stream to it.

ltspinfod has a couple of other features too:

  • It can do a shutdown or a reboot of a terminal.
  • It can read things from the /proc filesystem.

Both of those features are disabled by default, but it's really easy to enable them.

In lts.conf, the following entries control ltspfinod:

ALLOW_SHUTDOWN  =  Y
ALLOW_PROCREAD  =  Y

If you want to allow a remote shutdown and/or reboot to happen, then set ALLOW_SHUTDOWN = Y (the default is N).

Then, to actually get the server to send the shutdown/reboot message to the client, you'd use the ltspinfo script to do that.

It's installed on the server, in the /usr/sbin directory.

To run it, try something like this:

/usr/sbin/ltspinfo --host=ws001 --shutdown   (or --reboot)

If your terminals are fairly new hardware, with APM support in the bios, it should actually power down the client. If the terminal doesn't have an APM bios, it will kill the processes, but then just sit there.

If you want to read something from the /proc filesystem, you'd use the --proc argument to ltspinfo. For example, if you want to read /proc/meminfo on the client, to see information about the terminal's memory, you'd do this:

/usr/sbin/ltspinfo --host ws001 --proc meminfo

Notice I removed the leading /proc from the --proc argument. That is because the ltspinfod, running on the client will do a fork and a chroot() into the /proc directory. This is to prevent someone from reading anything else in the client filesystem. This is for security purposes. As we work on getting Kerberos and other security measures in place, we need to make sure nobody can grab private keys and such.

If you want to use ltspinfod for what it was originally designed for, you can use it like so:

/usr/sbin/ltspinfo --host ws001 --cfg XSERVER

Or, pretty much any other parameter from lts.conf can be used in the --cfg entry. You can also use --cfg=all that will retrieve all of the parameters from the workstation.

Anyway, I hope that helps,

Jim McQuillan

Personal tools