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

File Ownership & Permissions.

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

Post Reply
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

File Ownership & Permissions.

Post by Phil23 »

Hi all,

I've been playing with a rPi install now for almost a month & noticed something I don't quite get about the Linux file ownership.

Basically I started with a copy of my live data & changed the ini file to suit the Ecowitt.
Installed into /home/pi/CumulusMX Owner was pi.

What I noticed last week, is that the two new July data files had root as their owner & needed to change that to try an edit.
(Jul21Log.txt & the AirLink Log).
Is this what I should expect?

I'm not sure how it was running when the month rolled over as I've run it as a service at times & on other occasions started it with a script.

I've been referring to this https://cumuluswiki.org/a/MX_on_Linux & other pages, but don't see much reference to what happens regards new file creation under different conditions.

Trying to relate to to my Windows NTFS Permissions experience but not quit sure of the parallels.


Can someone try & put me on the right track & then I'll try & see how I can fit the answer into the Wiki.

Thanks

Phil.

Edit,

Just noticed ExtraLog202107.txt has now been created as I turned that option on.
It is owned by root.

It's data shows I turned the option on @ after 16:10 on 16/07 & at that time I would have started or had CMX running with this simple script.

Code: Select all

cd  CumulusMX
sudo mono CumulusMX.exe
So it is (currently still) running in a terminal window.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: File Ownership & Permissions.

Post by Phil23 »

Bit more info,

I just tried restarting it with just mono CumulusMX.exe & it crashed with:-
(and this log file was owned by pi).

Also notice that the MX Diags & the Backup Folders & Files are also owned by Root.
So does this mean that I'm missing something regarding how I've setup my permissions?

Obviously it crashed when run as pi due to the ownership of the backups folder.
(I get that much).

Phil.

Code: Select all

2021-07-18 11:18:59.467  ========================== Cumulus MX starting ==========================
2021-07-18 11:18:59.476 Command line: /home/pi/CumulusMX/CumulusMX.exe 
2021-07-18 11:18:59.476 Cumulus MX v.3.11.4 build 3133
2021-07-18 11:18:59.488 Platform: Unix
2021-07-18 11:18:59.489 OS version: Unix 5.10.17.7
2021-07-18 11:18:59.491 Mono version: 6.12.0.122 (tarball Mon Feb 22 17:44:05 UTC 2021)
2021-07-18 11:18:59.491 Current culture: English (Australia)
2021-07-18 11:18:59.491 Directory separator=[/] Decimal separator=[.] List separator=[,]
2021-07-18 11:18:59.492 Date separator=[/] Time separator=[:]
2021-07-18 11:18:59.492 Standard time zone name:   AEST
2021-07-18 11:18:59.492 Daylight saving time name: AEDT
2021-07-18 11:18:59.496 Daylight saving time? False
2021-07-18 11:18:59.496 18/07/2021 11:18:59 AM
2021-07-18 11:18:59.630 Reading Cumulus.ini file
2021-07-18 11:18:59.678 AvgSpdMins=10 AvgSpdTime=00:10:00
2021-07-18 11:18:59.681 Cumulus start date: 29/09/2016
2021-07-18 11:18:59.974 No start-up PING
2021-07-18 11:18:59.975 No start-up delay - disabled
2021-07-18 11:18:59.983 Data path = data/
!!! Unhandled Exception !!!
System.IO.IOException: Directory not empty
  at System.IO.FileSystem.RemoveDirectoryInternal (System.IO.DirectoryInfo directory, System.Boolean recursive, System.Boolean throwOnTopLevelDirectoryNotFound) [0x00114] in <533173d24dae460899d2b10975534bb0>:0 
  at System.IO.FileSystem.RemoveDirectory (System.String fullPath, System.Boolean recursive) [0x0000c] in <533173d24dae460899d2b10975534bb0>:0 
  at System.IO.Directory.Delete (System.String path, System.Boolean recursive) [0x00006] in <533173d24dae460899d2b10975534bb0>:0 
  at CumulusMX.Cumulus.BackupData (System.Boolean daily, System.DateTime timestamp) [0x00081] in <b85612c25ecc4b4d8aa1cbb49df1574e>:0 
  at CumulusMX.Cumulus..ctor (System.Int32 HTTPport, System.Boolean DebugEnabled, System.String startParms) [0x01e41] in <b85612c25ecc4b4d8aa1cbb49df1574e>:0 
  at CumulusMX.Program.RunAsAConsole (System.Int32 port, System.Boolean debug) [0x00048] in <b85612c25ecc4b4d8aa1cbb49df1574e>:0 
  at CumulusMX.Program.Main (System.String[] args) [0x0050d] in <b85612c25ecc4b4d8aa1cbb49df1574e>:0 
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: File Ownership & Permissions.

Post by HansR »

Nothing special about ownership setup but you probably created the original installation as pi and you run CMX as root so all new files are created as root.
If you do edits under pi maybe ou should run the whole thing as pi (if that is still possible, not sure) to have all files owner/group as pi/pi.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: File Ownership & Permissions.

Post by Phil23 »

Not sure now if I can run this to fix it so I can just run it as pi;-

Sudo chown pi:pi -R /home/pi/CumulusMX
and then
chmod ugo+rwx CumulusMX

But then what happens when I run it as a Service?
Does the Service run as root& also create new files as root.

I am assuming from what I read that you can stop the service & then run it in the console for testing.


Phil.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: File Ownership & Permissions.

Post by HansR »

If you

Code: Select all

chown -R pi *
and

Code: Select all

chgrp -R pi *
In the CumulusMX directory, all files are set to user and group pi.

Running as a service can be done as pi, but no doubt @mcrossley or @freddie are better to tell you how than I.
If you run under the console (user pi) CMX automatically will run as pi.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: File Ownership & Permissions.

Post by mcrossley »

When running as a service under Linux, you can edit the cumulusmx.service file to set the user and group the program will run under. The file as provided runs MX as root.

Code: Select all

[Service]
User=root
Group=root
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: File Ownership & Permissions.

Post by Phil23 »

Thanks Mark,

Was looking in that file before reading your post.
So I can change the User & group in there.

Presume Sudo is still needed to start & stop etc as I'd assume a regular user like Pi does not have permissions to control services.

Phil.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
Post Reply