MX on Linux: Difference between revisions
From Cumulus Wiki
Jump to navigationJump to search
NeilThomas (talk | contribs) |
m (→Installing/Configuring the MX service and the -service parameter: Remove obsolete text applying to early MX releases) |
||
Line 480: | Line 480: | ||
You don't use this parameter in a terminal or interactive instruction for running MX. Instead it appears within a file that we use to set up for running MX as a service. | You don't use this parameter in a terminal or interactive instruction for running MX. Instead it appears within a file that we use to set up for running MX as a service. | ||
====All users - mandatory edit of service file==== | |||
For recent releases, (see [https://cumulus.hosiene.co.uk/viewtopic.php?p=146473#p146473 original release announcement]): | For recent releases, (see [https://cumulus.hosiene.co.uk/viewtopic.php?p=146473#p146473 original release announcement]): | ||
#There is a task to do just once to configure the service | #There is a task to do just once to configure the service | ||
Line 494: | Line 495: | ||
There are some edits needed to that section: | There are some edits needed to that section: | ||
# Everyone must edit the line that begins with '''ExecStart=''' | # Everyone must edit the line that begins with '''ExecStart=''' | ||
#* The mandatory change is to replace '''/home/install''' by what you have selected for EXISTING PATH | #* The mandatory change is to replace '''/home/install''' by what you have selected for EXISTING PATH | ||
#* An optional change is to add additional parameters after the '''-service''' (select from '''-debug''', -locale, -port) as described in sub-sections above | #* An optional change is to add additional parameters after the '''-service''' (select from '''-debug''', -locale, -port) as described in sub-sections above | ||
====Technical users - optional edits==== | |||
Novice users are advised to skip this sub-section. | |||
In the ''[Service]'' section of same file: | |||
# Technical users might want to edit the '''User=root''' line so that the service will run as a different user, just change the name that appears after the "=" sign. | |||
In the '''[Unit]''' section of same file: | |||
* Depending on which release of MX you are using, you may, or may not, have a line saying <code>After=network-online.target</code> | |||
* Technical users may wish to edit this line into <code>After=network-online.target local-fs.target time-sync.target</code> | |||
*# The '''network-online.target''' specifies that the ''cumulusmx'' service will only start '''After''' the network service has started, i.e. there is a connection by LAN or Wireless to the internet. | |||
*# The '''local-fs.target''' specifies that the ''cumulusmx'' service will only start '''After''' the file service has started, i.e. your computer can read files | |||
*# The '''time-sync.target''' specifies that the ''cumulusmx'' service will only start '''After''' the computer has synced with either a real-time clock chip, or the time found on the internet, i.e. will ensure that Cumulus obtains the correct time from the computer to control all its actions | |||
====Completing the service file edit==== | |||
Regardless of whether you simply edited the path in the ''[Service]'' section, or you have also done some more technical edits: | |||
# Next save file with a new name '''cumulusmx_edited.service''' (using a new name stops it being overwritten when we upgrade MX | # Next save file with a new name '''cumulusmx_edited.service''' (using a new name stops it being overwritten when we upgrade MX | ||
# Now copy file to where it is needed to run the service <code>sudo cp EXISTING_PATH/CumulusMX/MXutils/linux/cumulusmx_edited.service /etc/systemd/system/cumulusmx.service</code> | # Now copy file to where it is needed to run the service <code>sudo cp EXISTING_PATH/CumulusMX/MXutils/linux/cumulusmx_edited.service /etc/systemd/system/cumulusmx.service</code> | ||
# Finally, optionally create a symbolic link to that file using <code>sudo systemctl enable cumulusmx</code> if you want the service to start after a reboot | # Finally, '''optionally''', create a symbolic link to that file using <code>sudo systemctl enable cumulusmx</code> if you want the service to start after a reboot | ||
If Cumulus MX is already running as a service, then the service is already defined, and to pick up the new definition: | |||
* Either reboot the computer | |||
* Or type <code>sudo systemctl daemon-reload</code> | |||
====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. | |||
* sudo systemctl start cumulusmx | |||
* sudo systemctl stop cumulusmx | |||
* sudo systemctl restart cumulusmx | |||
=== -debug parameter for adding debugging === | === -debug parameter for adding debugging === |