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?
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_____________________________________________________________________
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