[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltsp-discuss
Subject:    Re: [Ltsp-discuss] On no-chroot LTSP-PNP, use a clients-only .conf for an app?
From:       John Hupp <ltsp () prpcompany ! com>
Date:       2012-11-29 0:52:02
Message-ID: 50B6B1B2.5010906 () prpcompany ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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.

[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 11/24/2012 2:50 PM, John Hupp wrote:<br>
    </div>
    <blockquote cite="mid:50B124F8.6080403@prpcompany.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <br>
      <div class="moz-cite-prefix">On 11/21/2012 10:59 PM, Alkis
        Georgopoulos wrote:<br>
      </div>
      <blockquote cite="mid:50ADA331.1000701@gmail.com" type="cite">
        <pre wrap="">&#931;&#964;&#953;&#962; 22/11/2012 01:49 &#960;&#956;, \
&#959;/&#951; John Hupp &#941;&#947;&#961;&#945;&#968;&#949;: </pre>
        <blockquote type="cite">
          <pre wrap="">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?

</pre>
        </blockquote>
        <pre wrap="">
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" ] &amp;&amp; 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.

</pre>
      </blockquote>
      <font size="-1">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.<br>
        <br>
        [After a while I also realized that I needed to set that to
        executable.&nbsp; Newbies!]<br>
        <br>
        Initial content was:<br>
        <br>
        # For ISLTSPCLIENT=True set in LTS.conf, this modifies server
        apcupsd.conf for booting on clients<br>
        <br>
        if "$ISLTSPCLIENT" ; then<br>
        &nbsp;&nbsp;&nbsp; [ -w "/etc/apcupsd/apcupsd.conf" ] &amp;&amp; sed -i \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/UPSCABLE usb/UPSCABLE ether' \
                \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/UPSTYPE usb/UPSTYPE net' \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/DEVICE/DEVICE Lubuntu1:3551' \
                \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/TIMEOUT 105/TIMEOUT 60' \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/NETSERVER on/NETSERVER off' \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/NISIP 0.0.0.0/NISIP 127.0.0.1' \
\<br>  &nbsp;&nbsp;&nbsp; /etc/apcupsd/apcupsd.conf<br>
        fi<br>
        <br>
        When that didn't work, I thought, "Wait, for LTSP clients, we
        always want this behavior.&nbsp; No need to check a variable."&nbsp; So I
        simplified to:<br>
        <br>
        &nbsp;&nbsp;&nbsp; sed -i /etc/apcupsd/apcupsd.conf \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/UPSCABLE usb/UPSCABLE ether' \
                \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/UPSTYPE usb/UPSTYPE net' \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/DEVICE/DEVICE Lubuntu1:3551' \
                \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/TIMEOUT 105/TIMEOUT 60' \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/NETSERVER on/NETSERVER off' \<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -e 's/NISIP 0.0.0.0/NISIP \
127.0.0.1'<br>  <br>
        That didn't work either (manifested most clearly by the fact
        that the client does not initia<font size="-1">te shutdown 45
          seconds before the server, as the above configuration would
          dictate, but tries -- and fails -- to shut down when th<font
            size="-1">e server shuts down</font>).&nbsp; </font>Anyone know
        why I'm not getting results?</font></blockquote>
    <br>
    <font size="-1">Continuing to puzzle over this, I realize that, as
      usual, I barely know enough to ask a good question.&nbsp; But to review
      some bits I have gathered:<br>
      <br>
      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.<br>
      <br>
      On the LTSP server, apcapsd loads from the symlink in the
      appropriate /etc/rc?.d folder.&nbsp; From some general reading, I
      imagine this would be rc3.d.<br>
      <br>
      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.<br>
      <br>
      *After that*, lts.conf is parsed and relevant variables are
      created in the client environment.<br>
      <br>
      But I find no documentation regarding scripts in
      /usr/share/ltsp/init-ltsp.d.&nbsp; Is this an LTSP-PNP innovation?&nbsp;
      Could it be that these scripts are executed after apcupsd has
      already started in the client environment?&nbsp; If that is so, then
      using a&nbsp; /usr/share/ltsp/init-ltsp.d/50-apcupsd script to edit
      /etc/apcupsd/apcupsd.conf would have no effect.&nbsp; As a remedy, <font
        size="-1">c</font>ould I use that same script (or another to be
      run after it) to restart apcupsd with a revised apcupsd.conf?<br>
      <br>
      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.&nbsp; (I.e. until X server starts an encrypted ssh tunnel
      to the server.)&nbsp; I am imagining here that LTSP-PNP differ<font
        size="-1">s from s<font size="-1">tandard LTSP 5 mostly in its <font
            size="-1">method of creating/maint<font size="-1">aining the
              image<font size="-1">, and that use of the image during
                the boot process and other features of LTSP remain the
                same.</font></font></font></font></font></font><br>
  </body>
</html>



------------------------------------------------------------------------------
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic