[PLUG] Writing a script for use with LTSP...

robinsoq robinsoq at mail.opusnet.com
Sat Jul 19 15:40:02 UTC 2003


I've done some revision on the script 
I am creating a short array 
with the two boot options I want to 
give to ordinary clients and I have 
modified the short menu test so that 
it is skipped for both admin and root.  
The short menu part of the program 
still doesn't do anything with
the selections as I don't know yet
how to detect what terminal I'm being
called from.

Right now I've discovered using my
modified script as root that it 
works since root can perform the 
symbolic link modifications :-)  

Now, how do I give an ordinary user,
namely admin, the ability through my 
script to change symbolic links under 
/tftpboot which is normally and in my 
case owned by user root group root? 

I imagine bash scripts can create and
read from files.  If I could write the
boot option and the link to change to
a file, maybe I could write another 
root owned cron script to read this 
file and perform the requested 
changes.

My biggest problem right now is 
figuring out for non root users 
which terminal they are on.  

Another thought is timing, 
you don't want to try to change 
your boot option when the cron 
job is going to change it back 
to ltsp before you reboot.  One 
thing I'd like to do with my 
script is output the current time 
and the recommended time to reset 
the terminal and boot into the new 
selection.  Changes requested 10 
minutes after the start of the 
current twenty minute period 
should probably be queued to 
be set one minute after the 
start of the next period.

Surprisingly, without restarting 
dhcpd my booting switched from 
memtest back to ltsp on it's own 
just from the timed link 
restoration I've set up.

Is there a way to read an ordinary 
user's environment variables from 
a root owned script?  The latter 
may offer an alternative to 
users writing their boot selections 
to files.

It looks like only root can change
these links which suggests to me
that my script is going to have
to record for non root users what
they want root to do unless my 
script can be treated as a root
program no matter who is using it.

Everything is about changing these
links under /tftpboot and knowing 
what terminal the request is coming 
from if the user is not admin or 
root.  Knowing which terminal to 
change prevents an ordinary user 
from modifying the boot option on 
another user's terminal where the
non root options aren't going to
be lethal though someone else 
changing them on you could be 
annoying. 




More information about the PLUG mailing list