jpsc wrote:Ah yes
Code: Select all
echo "$(date +"%Y-%m-%d %H:%M:%S") CumulusMX init.d-Script: CumulusMX is being started at system boot within "$x" seconds"
would be better
hi John, I choosed this output <"$(date +"%b %m %H:%M:%S")> to be similar to the date format in the syslog logfile
Jun 7 23:21:30 WeatherServer systemd[1]: Startup finished in 3.285s (kernel) + 41.874s (userspace) = 45.159s.
Jun 7 23:21:42 WeatherServer dhcpcd[602]: eth0: Router Advertisement
Jun 06 23:27:45 CumulusMX init.d-Script: CumulusMX is being started at system boot within 0 seconds
You also asked: but why the Jun 06 date?
pi@WeatherServer:~ $ sudo grep -i version /etc/init.d/cumulusmx
# Version: 1.1 - 06.06.2016
This is only within the scriopt, verison number and when modified the scirpt....this is not in the oputput
Anyway, finally the new init.d Script is working on your 8GB SD Card with Jessie but not on your 4 GB Card with Jessie, correct?
This is strange....and I have no Idea, but you can do such a test:
As I already mentioned the new version is checking if the file
/mnt/SSD/CumulusMX/Cumulux.ini exists. If not it will loop for max 30 seconds until the file is accessible.
When you call the script with
sudo /etc/init.d/cumulusmx status you will get immidiately the result.
So how can we emulate a situation which is similar to the boot time, when the external drive is not accessible when the script is being called.
sudo nano /etc/init.d/cumulusmx
Go to the section where your path to CumulusMX is ....
### END INIT INFO
CumulusMX_HOME=/mnt/SSD/CumulusMX
CumulusMX_USER=root
and change the path to
/mnt/SSD/CumulusM (so the path does not exist - rmeove the X at the end)
Now call the script again.....and it should delay for 30 seconds before it prints the status, correct?
I double checked this on my differet Pi's.
I changed the line
while [ "$x" -lt 300 -a ! -e $CumulusMX_HOME/Cumulus.ini ]; do
to
while [ "$x" -lt 300 -a ! -e /tmp/test ]; do
I opened a second SSH session and in the first session I called:
sudo /etc/init.d/cumulusmx status and my script delayed
in the other SSH session I typed:
touch /tmp/test to create the test file
And in this moment, my Scirpt found the /tmp/test file and proceeds with the status command immidiately.
Jan