On 11/24/2012 2:50 PM, John Hupp wrote:

On 11/21/2012 10:59 PM, Alkis Georgopoulos wrote:
???? 22/11/2012 01:49 ??, ?/? John Hupp ??????:
The client-server implementation of the UPS manager daemon apcupsd
relies on configuring /etc/apcupsd/apcupsd.conf differently on client
and server machines.

Under standard LTSP5 with a chroot this was accomplished
straightforwardly enough.

Can I somehow achieve the same result with LTSP-PNP?

The usual LTSP way to configure files on the client is to declare
variables in lts.conf, for example
SCANNER=True,
and then to have boot-time scripts that process them, e.g.
$ cat /usr/share/ltsp/init-ltsp.d/50-saned
# This file is sourced
if boolean_is_true "$SCANNER" ; then
     [ -w "/etc/default/saned" ] && sed -i -e 's/RUN=no/RUN=yes/'
/etc/default/saned
fi

So what you need is a /usr/share/ltsp/init-ltsp.d/50-apcupsd script.

I hadn't known that lts.conf could be used to set variables other than the ones defined for its usage, but I added "ISLTSPCLIENT=True" and then created /usr/share/ltsp/init-ltsp.d/50-apcupsd.

[After a while I also realized that I needed to set that to executable. Newbies!]

Initial content was:

# For ISLTSPCLIENT=True set in LTS.conf, this modifies server apcupsd.conf for booting on clients

if "$ISLTSPCLIENT" ; then
    [ -w "/etc/apcupsd/apcupsd.conf" ] && sed -i \
        -e 's/UPSCABLE usb/UPSCABLE ether' \
        -e 's/UPSTYPE usb/UPSTYPE net' \
        -e 's/DEVICE/DEVICE Lubuntu1:3551' \
        -e 's/TIMEOUT 105/TIMEOUT 60' \
        -e 's/NETSERVER on/NETSERVER off' \
        -e 's/NISIP 0.0.0.0/NISIP 127.0.0.1' \
    /etc/apcupsd/apcupsd.conf
fi

When that didn't work, I thought, "Wait, for LTSP clients, we always want this behavior. No need to check a variable." So I simplified to:

    sed -i /etc/apcupsd/apcupsd.conf \
        -e 's/UPSCABLE usb/UPSCABLE ether' \
        -e 's/UPSTYPE usb/UPSTYPE net' \
        -e 's/DEVICE/DEVICE Lubuntu1:3551' \
        -e 's/TIMEOUT 105/TIMEOUT 60' \
        -e 's/NETSERVER on/NETSERVER off' \
        -e 's/NISIP 0.0.0.0/NISIP 127.0.0.1'

That didn't work either (manifested most clearly by the fact that the client does not initiate shutdown 45 seconds before the server, as the above configuration would dictate, but tries -- and fails -- to shut down when the server shuts down). Anyone know why I'm not getting results?

Continuing to puzzle over this, I realize that, as usual, I barely know enough to ask a good question. But to review some bits I have gathered:

Background: The apcupsd master-slave configuration (I called it client-server above, but that is not apcupsd's nomenclature) relies on an instance of apcupsd running on each machine, and it functions in master mode or slave mode depending on entries in /etc/apcupsd/apcupsd.conf.

On the LTSP server, apcapsd loads from the symlink in the appropriate /etc/rc?.d folder. From some general reading, I imagine this would be rc3.d.

According to the LTSP 5 manual's Ch. 6 coverage of "The boot process of a thin client," /sbin/init will run commands in the /etc/rc2.d directory, which also launches apcupsd.

*After that*, lts.conf is parsed and relevant variables are created in the client environment.

But I find no documentation regarding scripts in /usr/share/ltsp/init-ltsp.d. Is this an LTSP-PNP innovation? Could it be that these scripts are executed after apcupsd has already started in the client environment? If that is so, then using a /usr/share/ltsp/init-ltsp.d/50-apcupsd script to edit /etc/apcupsd/apcupsd.conf would have no effect. As a remedy, could I use that same script (or another to be run after it) to restart apcupsd with a revised apcupsd.conf?

And a general architecture sort of question: It was not clear to me from "The boot process of a thin client" what is included in the stripped-down installation in the image and if everything referred to in the client boot process uses the filesystem from that image. (I.e. until X server starts an encrypted ssh tunnel to the server.) I am imagining here that LTSP-PNP differs from standard LTSP 5 mostly in its method of creating/maintaining the image, and that use of the image during the boot process and other features of LTSP remain the same.
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to