5,838
edits
No edit summary |
|||
Look at the <non-Wiki>[Service]</non-wiki> part of the file quoted above.
This states Cumulus should use root for both the user it runs under and for the group
Look at the rest of the file, the <non-Wiki>[Unit]</non-wiki> part.
For release 3.15.1 build 3170 (19 March 2022) onwards: you will see an extra line <code>Wants=network-online.target</code>
If you are a technical user, you might decide to edit this, you have to decide what is needed in your context.
As an example, add a blank line after <code>Documentation=https://cumuluswiki.org/a/Main_Page</code> and in that blank line, type <code>Requires= time-sync.target local-fs.target</code>. A standard raspberry pi computer does not have a real-time clock, so when you switch it on, the clock just continues from whatever the time was when it was switched off. If the computer has online access, then it can look up the correct time online and adjust its clock. We don't want MX to start until after the time has been synced, and we want the local file-system to be ready for MX to update/store files.
▲A standard raspberry pi computer does not have a real-time clock, so when you switch it on, the clock just continues from whatever the time was when it was switched off. If the computer has online access, then it can look up the correct time online and adjust its clock. We don't want MX to start until after the time has been synced, and we want the local file-system to be ready for MX to update/store files. THe extra line ensures (Requires) these events have happened before MX can start.
# Entries
#* The terminology "After" tells "systemd" that what is named can be started after MX, in this case it does not guarantee that the network service (to send data to a remote web server) will be started
#* The terminology "Wants" tells "systemd" that what is named is wanted now, i.e. try to start before MX, but still start MX
#* The terminology ''Requires'' tells "systemd" that the "cumulusmx" service should not be started until the services specified on that line have successfully started
#*# The '''local-fs.target''' specifies that the ''cumulusmx'' service requires the file service to have started, i.e. checks your computer can read files before it attempts to start the ''cumulusmx'' service
#*#* If you are using a weather station type that does not time-stamp the readings it supplies to a Raspberry Pi, adding that target reference is important
#*#* A standard RPi does not include a real time clock chip (it can be added via connections available), therefore when the RPi boots it initially uses a dummy clock, and this sets the time to when the RPi was last running.
#*#* That means without this target being included, a newly booted-up RPi will tell Cumulus MX the time is just after when the computer was shut down, that might be very different to the true current time. It means your Cumulus MX on restarting will skip the catch-up of historic data (should your weather station settings make that available).
#*#* When the Raspberry Pi does do a time-sync, the time will suddenly jump, this is serious if this means the "rollover" time has been skipped over, as it implies the "dayfile.txt" will miss a line, and many measurements will be logged to wrong day.
''Don't forget to save the file under a new name, and copy it as instructed in previous subsection.''
===Commands to start, stop, or restart (stop and start in one command) MX as a service===
You will need to start (or restart) MX after you have defined (or redefined) the service as instructed above. The full set of commands to use with this service are at [[Raspberry_Pi_Image#systemctl_commands|systemctl_commands]], here I simply repeat the basic commands that can be used with any service (start, stop, and restart).
In all these commands, '''just replace [service_name] with ''cumulusmx''''' (or enter the name of another service).
* sudo systemctl start [service_name]
* sudo systemctl stop [service_name]
* sudo systemctl restart [service_name]
If you want MX to automatically start when your Linux computer is booted, just type <code>sudo systemctl enable [service_name]</code> once, and it will be activated on each reboot. Change the "enable" into "disable" if you don't want an automatic restart.
|
edits