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

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 »

richard_newberry wrote:All my files have owner of user cumulus by using chown -R cumulus:cumulus /home/cumulus/CumulusMX everything in that folder is the owner of user 'cumulus' and it works.
Hell richard
This is the best, in my oppinion. since the last version of my script, CumulusMX can be alternatively started as a non root user, for exmaple pi.

As I already mentioned, a mixed environemtn is not recommeneded. You nned to decide to use user pi or sudo.
when you try to start the ./cumulusmx.sh -s without sudo, you are starting the Scirpt and CumulusMX as the same user as you logged in. If you have started the Script with sudo before, you will get a warning message like this
1. sudo ./cumulusmx.sh -q (this will quit CumulusMX
2. ./cumulusmx.sh (to start CumulusMX as a normal user pi)
you will see this warning:

You are running CumulusMX not as root (sudo) but as user: pi - but I found files in /home/pi/CumulusMX/ which are having different owners
pi
root
This probably happened because this Script was previously started with sudo and now without sudo.
This might cause trouble, because of <Permission Denied> problems to read and write files.
Please fix this problem by using this command: sudo chown -R pi:pi /home/pi/CumulusMX/
This will change the owner of all files in /home/pi/CumulusMX/ to owner: pi

If you want to check the files and owners by yourself, please use this command:
sudo find /home/pi/CumulusMX/ -type f -printf '%u %p\n' |sort |more


you can now use this command, to list the file in CumulusMX/ folder hwich are not writeable by user pi
sudo find /home/pi/CumulusMX/ -type f -printf '%u %p\n' |sort |more
So before the script will start again, the onwership of all filesshould be set correctly.
If you decide ton conitnue woth sudo, it is okay as it is
But if you decide to work as user pi form now on, you need to set the ownershiup correctly by using this command
sudo chown -R pi:pi /home/pi/CumulusMX/

Form this moment, the init.d script should also be changed to (sudo nano /etc/init.d/cumulusmx)
CumulusMX_USER=pi
At reboot, CumulusMX will be started by user pi form now on.

If you dedcided to use always sudo to work with CumulusMX and but changed the /etc/init.d script to start as pi, it will not worlk and the script will terminate with the error messae above. But since the Script is being started at system boot, it can not display any error messages.

However richard, can you confirm, that the /etc/init.d script is starting on your RaspberryPi ?
Until now, I have only 3 own devices where I tested it successfully.
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 »

peter94506 wrote:
jank wrote:Can you please have a Look at the /etc/init.d/cumulusmx. For These 2 Lines?

CumulusMX_HOME=/home/pi/CumulusMX
CumulusMX_USER=root
Is it the Same in your File?
yes, it's the same, I also tried it with pi user.
I checked the output of syslog and finally, cumulusmx is bein started at system byt using the init.d
This only means, that the Script cumulusmx.sh is bein started.
My quesiton: are oyu 100% sure, that cumulusmx.sh is not being started by any workign cronjob anymore ?
please check
1. cronatb -e
2. sudo crontab -e
3. sudo cat /etc/crontab
4. sudo ls /etc/cron.d

There should no active @reboot which looks like "cumulusmx.sh"

Please read my post before this post regarding access rights.
you should make a decision, using pi or sudo. using sudo should always work, but using another user will not start the script anymore without changing the onwners of the files first.

you can do the following. If you decide to work as user root, make sure, the /etc/init.d/cumulusmx user is "root"

sudo /home/pi/CumulusMX/cumulusmx.sh -q (This will stop CumulusMX)
sudo /etc/init.d/cumulusmx start (This will start CumulusMX by uising the init.d script which is starting my script)
Now please wait a minute and check if CumulusMX is running by using 2 different commands
sudo /etc/init.d/cumulusmx status
sudo /home/pi/CumulusMX/cumulusmx.sh -s

Both commands should indicate that CumulusMX is running.
If this is true, we are sure, that sudo /etc/init.d/cumulusmx start is able to start it.
mv /var/log/syslog /var/log/syslog_old (this will move a logfile to clean a little bit)
sudo reboot (reboot the Raspberry Pi)
Once it is up again: grep -i cumulusmx /var/log/syslog
you should see 3 entries

Code: Select all

Jan 18 14:39:15 raspberrypi systemd[1]: Starting LSB: Start cumulusmx.sh (CumulusMX) at boot time...
Jan 18 14:39:54 raspberrypi cumulusmx[351]: Starting CumulusMX...
Jan 18 14:39:54 raspberrypi systemd[1]: Started LSB: Start cumulusmx.sh (CumulusMX) at boot time.
Line 1 is the shutdown signal for the init.d script
Line 3 is a Information that the system started the Init.d Script at boot time
Line 2 (in the same second as line 3) indicate that the init.d script is called with option START
printf "%-50s" "Starting $NAME..."

Once this is done, please make a screenshot of the grep -i cumulusmx /var/log/syslog output.
Jan
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
peter94506
Posts: 13
Joined: Fri 24 Feb 2012 9:04 pm
Weather Station: wrm100n
Operating System: win 7
Location: usa

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by peter94506 »

Thanks Jan, I'll give it another try tonight and report back. There might be a cronjob from my other attempt.
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 »

Hi,

I've tried out the init.d script and updated to V2.5.0

Error i'm getting is ifconfig command not found

error messages below: 

./cumulusmx.sh: line 148: ifconfig: command not found
./cumulusmx.sh: line 149: ifconfig: command not found
no port to connect to
./cumulusmx.sh: line 573: ifconfig: command not found
./cumulusmx.sh: line 574: ifconfig: command not found

cumulus@debian:~/CumulusMX$ /etc/init.d/cumulusmx status
Checking CumulusMX... Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Process dead but pidfile exists

This is ran by user "cumulus"

Any suggestions would be appreciated.
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 »

richard_newberry wrote: ./cumulusmx.sh: line 148: ifconfig: command not found
./cumulusmx.sh: line 149: ifconfig: command not found no port to connect to
./cumulusmx.sh: line 573: ifconfig: command not found
./cumulusmx.sh: line 574: ifconfig: command not found

Hi Richard

all the 4 lines in the cumulusmx.sh script are looking like this:
IPADDRESS=$(ifconfig $INTERFACE | grep 'inet ' | cut -d: -f2 | awk '{ print $1}')
NETMASK=$(ifconfig $INTERFACE | grep 'inet ' | cut -d: -f4 | awk '{ print $1}')

as you can see, the Linux command "ifconfig" is being sued to get the IP Address and netmask of your RaspberryPi
richard_newberry wrote: cumulus@debian:~/CumulusMX$ /etc/init.d/cumulusmx status
Checking CumulusMX... Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Process dead but pidfile exists

This is ran by user "cumulus"
Any suggestions would be appreciated.

[/quote]
yes, clearly insufficient rights for your user cumulus
Your user cumulus is not able to start andy basic system commands like ifconfig for example.
If you like, login as user cumulus and insert the command "ifconfig eth0"
you should get your network stats as a result but I bet you will get a "command not found"
Please check.

btw: the result: "Process dead but pidfile exists" is also on my system......when calling "sudo /etc/init.d/cumulusmx status"
I need to check this.....but this will not prevent cumulusmx.sh to start......

Recommendation:
Please login as user "cumulus" since oyu decided to run cumulusMX as user cumulus.
1) try to start the script as user cumulus (./cumulusmx.sh -s) I bet you will get an error messages like
You are running CumulusMX not as root (sudo) but as user: cumulus - but I found files in /CumulusMX which are having different owners
Below, there are some suggestions how to change the user rights of all files in the CumulusMX directory.
Example: sudo chown -R cumulus:cumulus /home/pi/CumulusMX
Once the owner of all files in your CumulusMX Directory are owned by the user you now want to use to run CumulusMX, it should not be a problem to start cumulusmx.sh
but always try to start the script with the useraccount you want to use in the future.
Once the Script and CumulusMX is running well (Please fix the rights problem with ifconfig) you can edit the /etc/init.d/cumulusmx script and in the head of this Init.d Script you can set the owner, who is starting CumulusMX when system starts:

CumulusMX_HOME=/CumulusMX
CumulusMX_USER=cumulus
NAME=CumulusMX
PIDFILE=/tmp/$NAME.pid


in your case, change CumulusMX_USER to cumulusmx
and reboot.

the only problem you have is, the mix of users who run CumulusMX and Fileowners.
Background: If you start cumulusmx.sh with sudo (sudo ./cumulusmx.sh) all files created in this moment are osnerd by user root. Also CumulusMX data files in the data folder will be owned by user root.
when oyu now decide to start cumulusmx.sh as user cumulus or pi, they will not have rights to write and read these file owned by root.
This is the reason why my script is stopping at this moment and checking if the ownership of the files currently in the folder are the same as user who is starting cumulusmx.sh
By the way, this problem will also happen if you not use my Script to start CumulusMX!
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 »

Nah all files are owned by cumulus

Ifconfig eth0 came back not found.

I changed CumulusMX_HOME=/home/cumulus/CumulusMX

The problem is with ifconfig not letting user cumulus have access.

Can you edit your script so it can do this without restricted permissions?
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 »

richard_newberry wrote:Nah all files are owned by cumulus

Ifconfig eth0 came back not found.
Can you edit your script so it can do this without restricted permissions?
Richard, I fear, that for this user not only the command "ifconfig" is not allowed, I am using also other Basic Linux commands which might also fail.
CURL, WGET, ZIP , find and many more.
I would suggest to change the permissions of this "cumulus" user account to get more rights.....
I think, your RaspberryPI is no Multi User System.....so it makes no sense to restrict the users to not have rights to call ifconfig (and probably other commands)
so please make the following test. Maybe it is a very basic thing. Maybe the path is ot in your environment path.
Can you please check if this is working:

/sbin/ifconfig eth0
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 »

Hi,

Im not using a raspberry pi im using debian on vmware esxi 6.0.

I dont use root because its very dangerous using root.

Do i need user cumulus just to have rights to the ifconfig command if so how? Would the errors go away?

Thanks for your time with your help your giving me on this matter.
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 »

Hi Richard
can you try:
/sbin/ifconfig eth0
or
locate ifconfig

and sudo locate ifconfig and sudo /sbin/ifconfig eth0 if the above commands fail

when logged in as cumulus ?

and to answer your question: you can use whatever user you like to rtun CumulusMX but the user of your choice needs to have enough rights to start some basic commands.

The user "cumulus" was created by yourself on your VMWARE and unfortuately had not enough rights.....or and this is thr reaosn why I asked you to run the above command - User cumulus can not find this command on your system.
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 »

I will let you know in a bit what the commands say.

I may need to add user cumulus to access ifconfig.
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
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 »

Hi Mate,

The command /sbin/ifconfig eth0 works as user cumulus

but ifconfig doesn't.

So how do I get this working without those errors? script only uses ifconfig do I put /sbin before ifconfig?
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 »

Hi Richard
Give me some Time. I will find a way for you without modifying the program.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by freddie »

richard_newberry wrote:So how do I get this working without those errors? script only uses ifconfig do I put /sbin before ifconfig?
Add /sbin to the PATH environment variable for your "cumulus" user.
Freddie
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 »

Which path. There's so many paths lol.
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

2 Options:

Option 1: I will do this for you in my Script, adding an "export" line
Option 2: And I would prefer this--> Please read carefully here ---> http://blog.tordeu.com/?p=374

sudo nano /etc/profile
This file is probably looking like this

if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi

The red Line is for user root and the green for all other suers.
So maybe in root's line the sbin path is present in the users line not.
Add /sbin into this line and save
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin"

This should do it.
MAybe you need to logout and login again before it works
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
Post Reply