Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Conf Files Not Being Applied To Thin Clients #855

Open
Theknight2015 opened this issue Oct 8, 2024 · 12 comments
Open

Custom Conf Files Not Being Applied To Thin Clients #855

Theknight2015 opened this issue Oct 8, 2024 · 12 comments

Comments

@Theknight2015
Copy link

I would like to say in advance, thank you to anyone who is able and willing to help me figure out the issue I'm having and hopefully help me resolve said issue. I apologize if I'm not as fluent in how Thinstation works but I'll try my best to get any logs or data requested.

I'll just jump right in and start by saying that the conf files for my Thinstation do not seem to be working correctly. The thinstation.conf.buildtime file seems to be working correctly but the thinstation.hosts files and other files like it seem to be getting ignored.

Here is the link to the highlighted text for the instructions I'm using: INSTRUCTIONS HERE

Here's my specific scenario. I have a thinstation.hosts file with the following contents:

You can have any amount of spaces/tabs between names

HOST MAC GROUPS COMMENTS

thinstation1 XXXXXXXXXXXX TC_Group1 # First Thin Client

The PC with the MAC address that matches the MAC in the hosts file however does not take the host name of thinstation1. In fact it takes the designation of PC-TC-XXXXXXXXXXXX where the XXXXXXXXXXXX is the MAC Address. So obviously it's reading the correct MAC right? Then why is the thinstation.hosts file not being used??? (PC-TC-XXXXXXXXXXXX is derived from the NET_HOSTNAME=PC-TC-* line in my thinstation.conf.builtime file)

My second problem is that if I try to use the thinstation.conf-XXXXXXXXXXXX file format where XXXXXXXXXXXX is the MAC address, it also does not function. I know this because my thinstation.conf.builtime file has 3 sessions defined and my thinstation.conf-XXXXXXXXXXXX file has 4 sessions defined. When I boot the PC up that has a corresponding MAC it still only has 3 sessions from the buildtime file and not the file identified by the MAC address.

It's my understanding based on the previously mentioned instructions that the buildtime file is read first, then (in my case) the hosts file then so on until finally the thinstation.conf-XXXXXXXXXXXX file is read last right? If this is true and I have both a hosts file setup and a thinstation.conf-XXXXXXXXXXXX file setup, this should be working but it's not. Is there a conflict with having both a hosts file and a MAC specific file? Am I not configuring or formatting the files with correct naming syntax or something? I'm lost on this and would love some help.

@Doncuppjr
Copy link
Contributor

Those instructions could maybe use a little more detail. You don't really ts-classic, but only 'package netfiles' and NET_FILE_ENABLED=true in your .buildtime. After that, it does do some poking around on your tftp server for files. You should be able to look at your tftp server logs to see what exactly it's resolving as the path.

@Theknight2015
Copy link
Author

Okay so I have now uncommented package netfiles in my build.conf file as well as added NET_FILE_ENABLED=true to my thinstation.conf.buildtime file and the corresponding thinstation.conf-MACADDRESS file. I also moved the thinstation.conf-MACADDRESS and thinstation.hosts files to my tftp server root directory while leaving a copy of each in the original build directory. Still though, that does not seem to work. The ThinClient is still booting up as PC-TC-XXXXXXXXXXXX I have attached all my conf and build files for reference. You will find them in the attached zip folder.
ThinStationConfFiles.zip

@Theknight2015
Copy link
Author

I also get these errors on my tftpd-hpa server logs:

2024-10-08T12:04:48.468730-05:00 PC-ThinStation in.tftpd[2252]: tftp: client does not accept options
2024-10-08T12:05:01.120016-05:00 PC-ThinStation CRON[2282]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

@Doncuppjr
Copy link
Contributor

Do you just want a local file with per station options, or do you want to host something on your network?

@Theknight2015
Copy link
Author

My goal is to pull individual configs (based on MAC Address) for various systems. Basically if PC1 needs a remote desktop Icon for Server 1 and Server 2 but PC2 only needs a Icon for Server 2, I want to be able to control this based on the thinstation.conf-XXXXXXXXXXXX files.

@Doncuppjr
Copy link
Contributor

Do you have your tftp server starting with verbosity? If so, it should tell you what files are trying to be pulled and from where.

@Theknight2015
Copy link
Author

Theknight2015 commented Oct 8, 2024

Yes, here is the output of that:

Oct 08 12:24:05 PC-ThinStation in.tftpd[2601]: RRQ from 192.168.1.59 filename /EFI/boot/grubx64.efi
Oct 08 12:24:05 PC-ThinStation in.tftpd[2601]: tftp: client does not accept options
Oct 08 12:24:05 PC-ThinStation in.tftpd[2602]: RRQ from 192.168.1.59 filename /EFI/boot/grubx64.efi
Oct 08 12:24:06 PC-ThinStation in.tftpd[2603]: RRQ from 192.168.1.88 filename /EFI/boot/grubx64.efi
Oct 08 12:24:13 PC-ThinStation in.tftpd[2621]: RRQ from 192.168.1.59 filename /boot/grub/grub.cfg-C0
Oct 08 12:24:13 PC-ThinStation in.tftpd[2623]: RRQ from 192.168.1.59 filename /boot/grub/grub.cfg
Oct 08 12:24:13 PC-ThinStation in.tftpd[2625]: RRQ from 192.168.1.59 filename /boot/grub/x86_64-efi/fs.lst
Oct 08 12:24:13 PC-ThinStation in.tftpd[2628]: RRQ from 192.168.1.59 filename /boot/grub/grub.cfg
Oct 08 12:24:13 PC-ThinStation in.tftpd[2629]: RRQ from 192.168.1.59 filename /boot/vmlinuz
Oct 08 12:24:15 PC-ThinStation in.tftpd[2630]: RRQ from 192.168.1.59 filename /boot/initrd
Oct 08 12:24:32 PC-ThinStation in.tftpd[2631]: RRQ from 192.168.1.59 filename boot/lib.squash
Oct 08 12:25:07 PC-ThinStation in.tftpd[2636]: RRQ from 192.168.1.59 filename //thinstation.hosts
Oct 08 12:25:09 PC-ThinStation in.tftpd[2638]: RRQ from 192.168.1.88 filename /EFI/boot/grubx64.efi

It seems to pull the hosts file (IE second to last line) but not the thinstation.conf-XXXXXXXXXXXX file at any point. It is renaming the machine now. I am also not sure what the "client does not accept options" error is in the second line.

@Doncuppjr
Copy link
Contributor

It's kind of a red hearing, tftpd is trying to tell the client what blocksize to use, but busybox tftp doesn't take those options. Look in your build.conf, there should be something about BASEPATH and BASENAME, so the full path would be something like $BASEPATH/$BASENAME.conf-$CLIENT_IP
$BASEPATH/$BASENAME.conf-$CLIENT_NAME
$BASEPATH/$BASENAME.conf-$CLIENT_MAC

@Theknight2015
Copy link
Author

In my build.conf file,

param basename thinstation
param basepath /

are the current settings. Do I need to change them to something else? I apologize if I'm not understanding. Right now my basename is thinstation which is what it came set to. I believe this is for the thinstation.conf files as if I were to change Thinstation to something else I would also have to change the conf files to somethingelse.conf as well, right?
The basepath is set to / to indicate the root directory of my tftp server is where to find the files.

Are you saying I need to change these values?

@Doncuppjr
Copy link
Contributor

I think if you want to use the root of your tftp server, just comment out basepath. The file that uses those variables and does the downloading is here,
/build/packages/netfiles/etc/init.d/network-files
It's a tricky file and goes way back to the early days of ThinStation. I personally never had much use for it, but there are quite a few people that do use it.

@Doncuppjr
Copy link
Contributor

But again, if your verbosity is turned up, your server logs should tell you what is being asked for.

@Theknight2015
Copy link
Author

Okay. I found a work around for my issue. I have created a thinstation.hosts file in the tftp root directory. I have added all the device MAC addresses and hostnames to that file one line at a time.
pc-tc-01 B88584C5501F TC_Group1 # One Persons PC
pc-tc-02 681DEF4653CD TC_Group1 # Another Persons PC

I then created a file in the same tftp root directory called thinstation.conf-pc-tc-01 and another file called thinstation.conf-pc-tc-02. These files correspond to the Hostnames that match the MAC addresses in the hosts files. (IE: The MAC address is compared against the hosts file and given a specific host name if the MAC is found in that file. If it' not found in that hosts file it's given a generic name.) On boot, the operating system looks for the thinstation.conf-MyHostName files and matches the MyHostName portion of the file name with the forementioned host name in the hosts file. This allows settings of the thinstation.conf-pc-tc-01 file to only be applied to the PC with the host name of pc-tc-01 set in the hosts file and so forth. If there is no file, the thinstation.conf.buildtime file is used.

This seems to be working as expected for now. I tried various methods but no matter what I did, the thinstation.conf-MACADDRESS files were never even being requested form the server according to the log of the tftp server but the moment I switched to using thinstation.conf-HOSTNAME files, it worked perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants