Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

RaspberryPi: CumulusMX init.d System Startup Script

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

OK, I changed the permissions all to pi and rebooted. CumulusMX started fine. Thank you my friend.

One last question. Can the DD backup directory be the same Windows share I mounted?
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jank »

VTHokie74 wrote:OK, I changed the permissions all to pi and rebooted. CumulusMX started fine. Thank you my friend.

One last question. Can the DD backup directory be the same Windows share I mounted?
Sure.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

I checked this morning to see if I got any backups from the Raspberry to my Windows share folder. Nope, nothing was there. I checked the owner of the mounted directory /home/pi/windowsshare/backup and sure enough it was root. I ran chown to change the owner from root to pi and ran a backup using -b -z parameters and everything worked. I am guessing if you use sudo nano /etc/fstab to add the mount directory it sets the owner as user root even if you are logged in an SSH terminal window as user pi.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jank »

I would more or less say that it is not a problem of "who created an entry in th fstab" because pi should not have rights to modify /etc/fstab ....only root sould do this.
In your case someone has created the windows share and user pi has no rights to access this windows share.
In my fstab you can see some windows (samba) shares and a nfs (linux) share.

192.168.193.3:/export/Public /mnt/Public nfs rsize=8192,wsize=8192,timeo=14,intr 0 0
//192.168.193.3/Kerio_logs /var/log/kerio cifs username=jank,password=secret,iocharset=utf8,sec=ntlm 0 0
in bold, oyu can see that my windows share in the fstab is connecting as user: jank with the password: secret

did you have a username password in your share line ? If you here insert root and it''s password, you should run also the backup as user pi.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

This is what I added to the /etc/fstab file:

//routerdrive1/RaspberryPi /home/pi/routerdrive1/backup cifs username=xxxxxx,password=xxxxx,workgroup=WORKGROUP

The username and password are the router password. My network drive is connected directly to a USB port on my router and shared out to my network. "//routerdrive1/RaspberryPi" is the Windows network path for the drive and folder.

I edited the file logged in as pi using "sudo nano /etc/fstab".
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jank »

VTHokie74 wrote:This is what I added to the /etc/fstab file:

//routerdrive1/RaspberryPi /home/pi/routerdrive1/backup cifs username=xxxxxx,password=xxxxx,workgroup=WORKGROUP

The username and password are the router password. My network drive is connected directly to a USB port on my router and shared out to my network. "//routerdrive1/RaspberryPi" is the Windows network path for the drive and folder.
I edited the file logged in as pi using "sudo nano /etc/fstab".
Ahh okay. first of all, try: nano /etc/fstab make a change anywhere in this file (example: almost on top
#test
and try to save this file. You will see, that you are not allowed as user pi. Thats the reason, why you need to use sudo to modify such a system file.

I assume, your Router is having any SSH access ? ...and you are using root on your router to create the share //routerdrive1/RaspberryPi /home/pi/routerdrive1/backup folder ?
Try this one to change the owner of the share:
sudo chown pi:pi /home/pi/routerdrive1/backup I hope, after doing this, you are allowed to add/store/backup files to this share
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

jank wrote: Ahh okay. first of all, try: nano /etc/fstab make a change anywhere in this file (example: almost on top
#test
and try to save this file. You will see, that you are not allowed as user pi. Thats the reason, why you need to use sudo to modify such a system file.
Correct. I opened the file with nano as pi from /home/pi and I got a a permission denied error when I attempted to save the changes.
I assume, your Router is having any SSH access ? ...and you are using root on your router to create the share //routerdrive1/RaspberryPi /home/pi/routerdrive1/backup folder ?
I am not sure about SSH. I just plugged the USB drive into a PC to access it that way. Then I created a \Raspberry\ backup folder using file manager in Windows. I plugged the drive back into the router and the folder was there. I think I could have done this through the router interface but my method worked.
Try this one to change the owner of the share:
sudo chown pi:pi /home/pi/routerdrive1/backup I hope, after doing this, you are allowed to add/store/backup files to this share
Yes, I did exactly that earlier and I can now manually backup to the external network drive with the script and the -b option. I assume the daily backups should work now also. I will check tomorrow and see if they ran.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jank »

Great. Let me know if it works for you.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

The backup worked.

I remembered I had to go back and edit the crontab. I had taken everything out when the @reboot didn't work. I added the daily and weekly backup lines back at the bottom.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
User avatar
jpsc
Posts: 179
Joined: Tue 23 Aug 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Bullseye
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jpsc »

More feedback on the init.d no start.

You may recall that I had an 8GB SD Jessie Lite image that would boot and start cumulusmx and a 4GB image that would not. They were not identical but were built in the same way. I download Jessie Lite from raspbian.org and then add mono, Apache, etc. I then mount my SSD which has CumulusMX and the web server files. This way the SD card gets very little traffic, and is not subject to the corruption I regularly had when CumulusMX and data files were on it.

I have been running the 8GB image with no problems at all for the last few months (actually a clone of it on to a 16GB card because I could not find an 8GB SD with enough space) and so have not been back here at all. I have the SSD with the Pi in a Plusberry Pi case, all self contained.

I recently read of the new boot modes of the Pi3 and so bought one to experiment, hoping to eliminate the SD card entirely, booting directly from the SSD.

My first step was to build a bootable USB stick using the instructions here https://www.raspberrypi.org/blog/pi-3-b ... rage-boot/. I made sure I used a USB stick known to work - a Sandisk Cruzer Fit 16GB. Having cloned Jesse Lite on to it, it booted and I can now throw away my SD card (at least put it on a shelf in case of later trouble).

Next step copy the CumulusMX installation and Apache files from a temporarily mounted SSD, dismount that and get CumulusMX running from the booting USB stick - easy.

Next make another backup of CumulusMX in case, in case.

Finally repartition the SSD and clone the boot USB stick onto it.

I now have a Raspberry Pi that boots directly from SSD, no other storage media needed.


That is all very well but I found that the USB stick, and also the SSD build will not start the script at boot, just like the problems I had with the 4GB images. I am now using the -w watchdog switch in the script in crontab so can live with the startup delay.

I suppose my next move will be to clone the working 8GB SD card on to the Sandisk Cruzer Fit and see if that can be persuaded to start CumulusMX, if so it should work on the SSD. If not I will count my blessings and be happy with the current situation.


I just wanted to give my appreciation of a thoroughly good piece of work, and to show where it has got me.
John Cooper

Cumulus 3 on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jank »

jpsc wrote:More feedback on the init.d no start.You may recall that I had an 8GB SD Jessie Lite image that would boot and start cumulusmx
Yes, I recall and I already downloaded your SD Card image but had not the time trying it out......
jpsc wrote: I now have a Raspberry Pi that boots directly from SSD, no other storage media needed.
Wow, thats great and this might be the very best way to start a Reaspberry. But also using a SD Card just for the Boot process is good enough, because only a few files are being used during the boot (root is on SSD) and this will not damage a SD Card....for decades :-)
jpsc wrote: That is all very well but I found that the USB stick, and also the SSD build will not start the script at boot, just like the problems I had with the 4GB images. I am now using the -w watchdog switch in the script in crontab so can live with the startup delay.
I suppose my next move will be to clone the working 8GB SD card on to the Sandisk Cruzer Fit and see if that can be persuaded to start CumulusMX, if so it should work on the SSD. If not I will count my blessings and be happy with the current situation.
I just wanted to give my appreciation of a thoroughly good piece of work, and to show where it has got me.
thank you very much, but our goal should be, that the CumulusMX can start at system boot like all other deamons which are located in /etc/init.d, right?
OKay, you always cloned your installation form a USB/SSD/SD which not starts the CumulusMX init.d script....you never installed a new system? So you always cloned the error, or am I wrong?
My first impression when you used 2 devices (SD to boot and USB /SSD to work from) was, that the second device was not ready when the Script tried to start CumulusMX but this should not be the case when only 1 disc is being used......
But can you try this recommendation I mentioned in this post? ---> https://cumulus.hosiene.co.uk/viewtopic.p ... 30#p120756 Maybe the init Script is not correctly linked into the runlevels......Can you try using chkconfig command ?
Jan
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jank »

Today, after more then 200 days uptime, a network outage caused my Raspberry Pi to hang so I needed to reboot and once it came up again, the CumulusMX was not started by the init.d script.
After some minutes I found out, that the /etc/init.d/cumulusmx was set to run as user pi
CumulusMX_USER=pi

but since some files in the /CumulusMX Installation folder changed the ownership for any reason, the init.d script won't work anymore.

After changing the ownership for all files in the CumulusMX Installation folder back to pi, everything worked after the next reboot
sudo chown -R pi:pi /home/pi/CumulusMX

Maybe this was a reason, why some of you had no luck to get CumulusMX started when system starts?
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
richard_newberry
Posts: 481
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by richard_newberry »

some files keeps changing the ownership so I keep having to do it every now and then.
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jank »

Hello Richard
I am not 100% sure, but from time to time, I am also unsure, if soemthing has changed the ownership of one file. I thought I am 100% that I run CumulusMX as user pi, but weeks later, when I am trying to restart, it says that some files have changed the ownership.

I am sure, you know the commands to test it ?

Test 1. Check the owner ship of all files in the cumulusMX Dir ----> find /home/pi/CumulusMX/ -type f -printf "%u \n" |sort |uniq
Change the path in case it is installed somewhere else
If you see only 1 username, for xmaple pi, you can check it by using this command

Test 2- Check if the query is working: sudo touch /home/pi/CumulusMX/test test
Run command again: find /home/pi/CumulusMX/ -type f -printf "%u \n" |sort |uniq
You should see 2 usernames now
Delete file test ---> sudo rm /home/pi/CumulusMX/test

To test who's the owner of the PID file: stat -c %U /tmp/CumulusMX.pid

If you now see days later, that an owner of a file has changed, use the stat command.
Example: If the owner of the file test has changed: stat /home/pi/CumulusMX/test

This command will give you at least an information about any changes of the file....

I will do the same on my pi, but after 24 hours, all files still belong to user pi.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
BigOkie
Posts: 272
Joined: Tue 28 May 2013 1:06 am
Weather Station: Davis VP2 Plus
Operating System: Raspian Buster (RPi 3b)
Location: Tulsa, OK

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by BigOkie »

jank wrote:Today, after more then 200 days uptime, a network outage caused my Raspberry Pi to hang so I needed to reboot and once it came up again, the CumulusMX was not started by the init.d script.
After some minutes I found out, that the /etc/init.d/cumulusmx was set to run as user pi
CumulusMX_USER=pi

but since some files in the /CumulusMX Installation folder changed the ownership for any reason, the init.d script won't work anymore.

After changing the ownership for all files in the CumulusMX Installation folder back to pi, everything worked after the next reboot
sudo chown -R pi:pi /home/pi/CumulusMX

Maybe this was a reason, why some of you had no luck to get CumulusMX started when system starts?
when I implemented mine, that was one of the first things I changed.

However, on a subsequent reboot (which happened in much the same manner as yours did) it didn't start.

Wasn't understanding why until I installed chkconfig and noticed that the cumulusmx script was not set to start as evidenced by issuing the command chkconfig | grep cumulusmx and the result returned 'cumulusmx off'.

I believe running 'update-rc.d cumulusmx defaults', then running 'update-rc.d cumulusmx enable' solved that issue.
Post Reply