Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

RaspberryPi: CumulusMX init.d System Startup Script

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.
jank
Posts: 297
Joined: Sat Jun 13, 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jank » Mon Jun 13, 2016 1:01 pm

Hello John

I made a simple "debug" version for you.

1. Login to your raspberry pi and rename the existing cumulusmx into cumulusmx.org
sudo mv /etc/init.d/cumulusmx /etc/init.d/cumulusmx_org

2. download this debug version from here and transfer it to your Raspberry Pi into the folder /etc/init.d/
cumulusmx.zip


unzip the file: sudp unzip /etc/init.d/cumulusmx.zip
remove the zip: sudo rm /etc/init.d/cumulusmx.zip

3. Change Owner of this script to root
sudo chown root:root /etc/init.d/cumulusmx

4. Made it executable in case it is not: sudo chmod +x /etc/init.d/cumulusmx

reboot your system

Once it is up again, you should find a file /tmp/startup.log .
this file contain a few more information which parts of the init script are being started.
Send me the content of the file, once the you rebooted.

To revert the changes back to the original
a) sudo mv /etc/init.d/cumulusmx /etc/init.d/cumulusmx_debug
b) sudo mv /etc/init.d/cumulusmx_org /etc/init.d/cumulusmx
You do not have the required permissions to view the files attached to this post.
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
jpsc
Posts: 162
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jpsc » Wed Jun 15, 2016 7:28 pm

jank wrote:reboot your system

Once it is up again, you should find a file /tmp/startup.log .
this file contain a few more information which parts of the init script are being started.


This is the 8GB

Code: Select all

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jun 15 20:09:07 2016 from bomb20
pi@WeatherServer:~ $ cat /tmp/startup.log
START - Beore Loop
/mnt/SSD/CumulusMX/Cumulus.ini is available starting proceed
Started successfully with root <start>
pi@WeatherServer:~ $ sudo /etc/init.d/cumulusmx status
Jun 15 20:15:01 CumulusMX init.d-Script: CumulusMX is being started at system boot within 0 seconds
Checking CumulusMX...                             Running
pi@WeatherServer:~ $


This is the 4GB

Code: Select all

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jun 15 19:19:46 2016 from bomb20
pi@WeatherServer:~ $ cat /tmp/startup.log
START - Beore Loop
/mnt/SSD/CumulusMX/Cumulus.ini is available starting proceed
Started successfully with root <start>
pi@WeatherServer:~ $ sudo /etc/init.d/cumulusmx status
Jun 15 20:23:42 CumulusMX init.d-Script: CumulusMX is being started at system boot within 0 seconds
Checking CumulusMX...                             Service not running
pi@WeatherServer:~ $


Bizzarre, no?
John Cooper

Cumulus MX on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image

jank
Posts: 297
Joined: Sat Jun 13, 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jank » Wed Jun 15, 2016 9:05 pm

John
Have I already asked you, if you are able to start cumulusmx with the init script when the System is already being started? I mean 5 Minuts after system is booted?
The 4gb Card.
Wait 5 minutes After start
Check if cumulus is running (sudo /etc/init.d/cumulusmx status)
And Start it with /etc/init.d/cumulusmx start
And Check again with status. But please Keep in mind Cumulus needs about 30 seconds to fully Up and running.
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
jpsc
Posts: 162
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jpsc » Thu Jun 16, 2016 11:26 am

jank wrote:John
Have I already asked you, if you are able to start cumulusmx with the init script when the System is already being started? I mean 5 Minuts after system is booted?
The 4gb Card.
Wait 5 minutes After start
Check if cumulus is running (sudo /etc/init.d/cumulusmx status)
And Start it with /etc/init.d/cumulusmx start
And Check again with status. But please Keep in mind Cumulus needs about 30 seconds to fully Up and running.

yes, the scripts will start CumulusMX immediately after a login, no problems.
John Cooper

Cumulus MX on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image

jank
Posts: 297
Joined: Sat Jun 13, 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jank » Thu Jun 16, 2016 12:13 pm

Okay John....this is a really tricky thing
so we know, the init Script is coming to the point, where /mnt/SSD/CumulusMX/cumulusmx.sh is being started.
But for any reason, cumulusmx will not start.
You already know, there is another logfile.
I would suggest: Deletr the existing cumulusmxsh.log
sudo rm /mnt/SSD/CumulusMX/cumulusmxsh.log
restart the system and lets see, whats in the cumulusmxsh.log file. (/mnt/SSD/CumulusMX/cumulusmxsh.log)
Jan
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
jpsc
Posts: 162
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jpsc » Fri Jun 17, 2016 12:31 am

jank wrote:restart the system and lets see, whats in the cumulusmxsh.log file. (/mnt/SSD/CumulusMX/cumulusmxsh.log)

Code: Select all

pi@WeatherServer:~ $ sudo /etc/init.d/cumulusmx stop
Jun 17 01:19:34 CumulusMX init.d-Script: CumulusMX is being started at system boot within 0 seconds
Stopping CumulusMX

pi@WeatherServer:~ $ sudo rm /mnt/SSD/CumulusMX/cumulusmxsh.log
pi@WeatherServer:~ $ sudo shutdown -r now

Broadcast message from pi@WeatherServer on pts/1 (Fri 2016-06-17 01:20:43 BST):

The system is going down for reboot NOW!

pi@WeatherServer:~ $ Connection to 192.168.1.250 closed by remote host.
Connection to 192.168.1.250 closed.

RECONNECTING, PLEASE WAIT...

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Jun 17 01:08:45 2016
pi@WeatherServer:~ $ cat /mnt/SSD/CumulusMX/cumulusmxsh.log
2016-06-17 01:20:15 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-06-17 01:20:24 - System - CumulusMX is being Stopped with -q
pi@WeatherServer:~ $ sudo /etc/init.d/cumulusmx start
Jun 17 01:24:13 CumulusMX init.d-Script: CumulusMX is being started at system boot within 0 seconds
Starting CumulusMX...                             pi@WeatherServer:~ $ sudo /etc/init.d/cumulusmx status
Jun 17 01:25:01 CumulusMX init.d-Script: CumulusMX is being started at system boot within 0 seconds
Checking CumulusMX...                             Running
pi@WeatherServer:~ $ cat /mnt/SSD/CumulusMX/cumulusmxsh.log
2016-06-17 01:20:15 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-06-17 01:20:24 - System - CumulusMX is being Stopped with -q
2016-06-17 01:24:15 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-06-17 01:24:17 - CumulusMX trying to start with these parameters /mnt/SSD/CumulusMX/CumulusMX.exe -port 8998
2016-06-17 01:24:41 - System - CumulusMX is successfully being started

Is it due to the context the script is being run in at boot time? Everything else is the same.
John Cooper

Cumulus MX on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image

jank
Posts: 297
Joined: Sat Jun 13, 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jank » Mon Jun 20, 2016 12:50 pm

Hello John

sorry for answering late.....but a I had a lot of other things to do.....
well....I am still without any idea.

You deleted the cumulusmxsh.log and restarted the Pi.
After reboot, you looked into the cumulusmxsh.log and you can see, that while the system shutdown, it stopped the cumulusmx because you see 2 lines in this script after reboot (-q)
But, cumulusmx.sh was not started at boot time....definately not.
Then you waited 5 Minutes and started the init script manually and Cumuslux was started via init Script and cumulusmx.sh without any problems.

Conclusion: the init Script ran at reboot (Debug Version) but was not able to call the cumulusmx.sh script. (empty Logfile)

So I am out of ideas........

I have one remaining question and I am sure you already answered it, but maybe I did not get it :-)
On your 4GB SD Card, where the init Script is not working, when you insert a "sleep 30" in the upper area of this file
for example here: sudo nano /etc/init.d/cumulusmx

### END INIT INFO
CumulusMX_HOME=/CumulusMX
CumulusMX_USER=pi
sleep 30
NAME=CumulusMX
PIDFILE=/tmp/$NAME.pid


will this work ?
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
jpsc
Posts: 162
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jpsc » Mon Jun 20, 2016 2:23 pm

jank wrote:I have one remaining question and I am sure you already answered it, but maybe I did not get it :-)

will this work ?
I have tried a sleep at the top earlier but that does not work.

I think you are right that the cumulusmx.sh script is not run at all by the init script, for whatever reason. We know it is executable because the 8GB Jessie init can run it, but is it a permissions thing and the 4GB Jessie init has no rights?
John Cooper

Cumulus MX on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image

jank
Posts: 297
Joined: Sat Jun 13, 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jank » Mon Jun 20, 2016 2:35 pm

Hello John

you can compare the access right of the script with
ls -al /etc/init.d/cumulusmx

-rwxr-xr-x 1 root root 2213 Jun 8 10:08 /etc/init.d/cumulusmx

To change it in case
sudo chmod +x /etc/init.d/cumulusmx
sudo chown root:root /etc/init.d/cumulusmx

and if you like, you can try: sudo chmod 777 /etc/init.d/cumulusmx
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
jpsc
Posts: 162
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jpsc » Tue Jun 21, 2016 12:25 am

jank wrote:you can compare the access right of the script with
ls -al /etc/init.d/cumulusmx
That is owned by root, but we know that runs OK. The problem is with /mnt/SSD/CumulusMX/cumulusmx.sh - we do not have any evidence of that running at boot time. Does the Jessie OS running init on the 4GB card have the same access rights as the 8GB at boot time?

I checked and it was owned by pi:pi but changing that did not work:

Code: Select all

pi@WeatherServer:~ $ ls -hls /mnt/SSD/CumulusMX/cumulusmx.sh
68K -rwxrw-rw- 1 root root 67K May  3 14:30 /mnt/SSD/CumulusMX/cumulusmx.sh
John Cooper

Cumulus MX on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image

water01
Posts: 1419
Joined: Sat Aug 13, 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 7 64bit HP SP1
Location: Somewhere in the USA
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby water01 » Tue Jun 21, 2016 8:04 am

Surely your permissions therefore are incorrect
Numeric Mode 0762

Permissions rwxrw--w-

Special Attributes None

User Permissions read & write & execute

Group Permissions read & write

Other users Permissions write only


Therefore there is no execute permissions for root.

I would do a sudo chmod 777 /etc/init.d/cumulusmx as jank suggested then you know ALL users from ROOT upwards have execute permissions.

jank
Posts: 297
Joined: Sat Jun 13, 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jank » Tue Jun 21, 2016 2:35 pm

water01 wrote:Surely your permissions therefore are incorrect
Therefore there is no execute permissions for root.
I would do a sudo chmod 777 /etc/init.d/cumulusmx as jank suggested then you know ALL users from ROOT upwards have execute permissions.


Hello David....hopefully this will do it...otherwise I would ran out of ideas and my last option would be, to download an image of the 4GB SD Card and test locally on my Pi, until it works :-)

@John: For testing, please change the permissions of both file
sudo chmod 777 /etc/init.d/cumulusmx
sudo chmod 777 /mnt/SSD/CumulusMX/cumulusmx.sh
...to exclude a "missing rights" problem. Since you are the only owner and user of the raspberryPi, it should not be a security hole :-)
Jan
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
jpsc
Posts: 162
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jpsc » Tue Jun 21, 2016 10:49 pm

jank wrote:@John: For testing, please change the permissions of both file
sudo chmod 777 /etc/init.d/cumulusmx
sudo chmod 777 /mnt/SSD/CumulusMX/cumulusmx.sh
...to exclude a "missing rights" problem. Since you are the only owner and user of the raspberryPi, it should not be a security hole :-)
I so wanted that to work, it looked like the answer, although I think it not needed on the first one that does run at boot

Code: Select all

pi@WeatherServer:~ $ sudo chmod 777 /mnt/SSD/CumulusMX/cumulusmx.sh
pi@WeatherServer:~ $ ls -hls /mnt/SSD/CumulusMX/cumulusmx.sh
68K -rwxrwxrwx 1 root root 67K May  3 14:30 /mnt/SSD/CumulusMX/cumulusmx.sh
pi@WeatherServer:~ $ sudo chmod 777  /etc/init.d/cumulusmx
pi@WeatherServer:~ $ ls -hls /etc/init.d/cumulusmx
4.0K -rwxrwxrwx 1 root root 2.9K Jun 17 01:15 /etc/init.d/cumulusmx
but it doesn't.

I'll try putting the start section of cumulusmx.sh in cumulusmx
John Cooper

Cumulus MX on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image

jank
Posts: 297
Joined: Sat Jun 13, 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jank » Wed Jun 22, 2016 7:43 am

jpsc wrote:but it doesn't.
I'll try putting the start section of cumulusmx.sh in cumulusmx


John....I don't want to give up :-)
The next thing I would do would be with this 4GB SD Card:

sudo cp -rp /mnt/SSD/CumulusMX/ /tmp/CumulusMX
This will make a copy of the complete CumulusMX folder from your external device to the SD Card
Now please change the path information in file /etc/init.d/cumulusmx

CumulusMX_HOME=/CumulusMX
I think, no other file need to be changed.
Disconnect the Externla drive with the original CumulusMX folder (Because my cumulusmx scirpt will search for folders with name CumulusMX and I have no idea which one will be found first /tmp or external drive)

Once this is done, please try again if this change is able to boot.
If not,is it possible for you to create a DD Image of your SD Card and upload it somewhere on a drive where I can download it ?
I am not sure if your onternet connection is fast enough ? I have 120Mbit/s so it should not be a problem to download a 4GB File within minutes. If yes, I would send you the commands to create an image of your SD Card
(Before you do it, you should of course change the password of the user PI )
Jan
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
jpsc
Posts: 162
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Postby jpsc » Wed Jun 22, 2016 9:46 am

jank wrote:Once this is done, please try again if this change is able to boot.
I'll try this tonight
jank wrote:If not,is it possible for you to create a DD Image of your SD Card and upload it somewhere on a drive where I can download it ?
I am not sure if your onternet connection is fast enough ? I have 120Mbit/s so it should not be a problem to download a 4GB File within minutes. If yes, I would send you the commands to create an image of your SD Card
I am happy to do this, I'm only on 40Mb/s here in the sticks ;)
John Cooper

Cumulus MX on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image


Return to “Cumulus MX”

Who is online

Users browsing this forum: No registered users and 1 guest