Whys and Wherefores | Installation | Configuration | Log Files | Tweaks |
A few thin clients do not have a battery-backed RTC. The Wyse Sx0 is one of them. When my S10 starts up it assumes the date is March 29th 2006. We need to get this set correctly. There is a utility in Tiny Core called getTime.sh to help with this but I had limited success using it. I ended up installing the ntpclient application and using that instead.
First start by selecting a suitable ntp time server. Google can help here. I arbitrarily picked on ntp2c.mcc.ac.uk. (You could write a more sophisticated script that tried a series of time servers).
One issue we have here is that network has to be up before ntpclient can work. I ended up with this simple shell script in the /opt directory that I called settime.sh.
#!/bin/sh #Set the time once the network appears SERVER=ntp2d.mcc.ac.uk while ! nslookup $SERVER >/dev/null 2>&1 ; do sleep 1; done sleep 2 /usr/local/bin/ntpclient -s -h $SERVER &
..and added it to the bootlocal.sh file.
I should point out that this simple script will hang until it can see the designated NTP server.
As we're running the Web Server in headless mode there's no point in running the GUI desktop. The Tiny Core startup script doesn't run the GUI if it finds the a file named text sitting in the /etc/config directory. This is simple to setup: Create the file, add it to filetool.lst and then ensure the /etc/config is backed up.
root@mirror:~# echo >/etc/config/text root@mirror:~# echo etc/config/text >>/opt/.filetool.lst root@mirror:~# filetool.sh -b Backing up files to /mnt/sda1/tce/mydata.tgzDone root@mirror:~#
The alternative is to navigate into the /mnt/sda1/tce/boot/extlinux directory and edit the extlinux.conf file to add the word text to the command line.
I originally added this as there was an issue with the Wyse S10 in that could hang whilst booting, but this has now been fixed with the latest kernel. If you're running the system headless (no screen or keyboard) then the only way to know when the system has come up following a (re)start, is when it appears on the network. I decided to add some positive feedback that it was actually starting up by making it beep along the way.
First step was to create a simple script (beep.sh) that I saved in the /opt directory.
#!/bin/sh # Sound a number of beeps count=1 if [ $# != 0 ] ; then count=$1 fi while [ $count -ne 0 ] do echo -e "\007" ; sleep 1 count=$((count-1)) done
I then edited the bootlocal.sh file to call it twice - once at the start to give two beeps, and then again at the end to give four beeps. My bootlocal.sh ended up looking like:
#!/bin/sh # put other system startup commands here # # Announce our arrival /opt/beep.sh 2 # Set the time before doing anything else /opt/settime.sh # Start apps /usr/local/etc/init.d/dropbear start /usr/local/etc/init.d/samba start /usr/local/bin/apachectl -k start /usr/sbin/crond /sbin/syslogd # Announce we're done /opt/beep.sh 4
Whilst booting the system does take a while to mount all the extensions in the tce directory. Ideally it would be nice to get the first beeps when the main initialisation script gained control, but to do that it would mean remastering the core.gz file.
In November 2018 I added this article on how to add support for https.