Page 1 of 2

cumulusmx.service

Posted: Thu 10 Dec 2020 12:30 pm
by The Dalek Hunter
I have Cumulus MX running on a Raspberry Pi installed to /home/pi/CumulusMX
I want to keep the GUI so prefer not to use the preinstalled image.

At the moment I start it with
@reboot (sleep 30;cd /home/pi/CumulusMX;sudo mono CumulusMX.exe) &
in crontab

I would like to move to using cumulusmx.service but can't get it to work despite following the instructions!!

I assume I edit the path line like this ExecStart=/usr/bin/mono-service -d:/home/pi/CumulusMX CumulusMX.exe -service but I am not sure about the -d

Also what do I put for User and Group ??

Thanks

Re: cumulusmx.service

Posted: Thu 10 Dec 2020 1:22 pm
by freddie
-d is the directory in which you have MX installed.
User/group are the (Linux) user and group that you run MX under. As you are using sudo then your MX runs under user root. So you can use root for both user and group.

You say you can't get it to run - so what errors are you seeing?

Re: cumulusmx.service

Posted: Thu 10 Dec 2020 1:36 pm
by The Dalek Hunter
Thank you very very much - all sorted - you pointed me it the right direction - I wan't using sudo :groan:

Working perfectly

Re: cumulusmx.service

Posted: Thu 10 Dec 2020 2:16 pm
by freddie
The Dalek Hunter wrote: Thu 10 Dec 2020 1:36 pm Thank you very very much - all sorted - you pointed me it the right direction - I wan't using sudo
I'm confused now, as you definitely don't need to put sudo in your .service file. Or did you mean you weren't using sudo when you were starting MX using systemctl?

Re: cumulusmx.service

Posted: Thu 10 Dec 2020 4:31 pm
by The Dalek Hunter
I forgot to use *sudo* systemctl daemon-reload

Re: cumulusmx.service

Posted: Thu 10 Dec 2020 4:50 pm
by freddie
Okay fair enough :-)

Re: cumulusmx.service

Posted: Thu 10 Dec 2020 11:17 pm
by ChaserPeek
Hey Guys,

I would to start CumulusMX after booting of OS without SSH connection active.
I have a problem with cumulusmx.service. I follow instruction at this link https://github.com/cumulusmx/CumulusMX/ ... /tag/b3094

This is my new line edited: ExecStart=/usr/bin/mono-service -d:/home/ubuntu/CumulusMX CumulusMX.exe -service

I followed all other steps:

Code: Select all

sudo cp cumulusmx.service /etc/systemd/system/
sudo systemctl enable cumulusmx
sudo systemctl start cumulusmx
when I do "sudo systemctl start cumulusmx" I have error:

Code: Select all

Job for cumulusmx.service failed because the control process exited with error code. See"systemctl status cumulusmx.service" and "journalctl -xe" for details
I'm using bubuntu-18.04.4-console-armhf-2020-04-09

thanks!

Re: cumulusmx.service

Posted: Thu 10 Dec 2020 11:33 pm
by freddie
Can you post the output from these two commands:

Code: Select all

systemctl status cumulusmx.service
journalctl -xe

Re: cumulusmx.service

Posted: Fri 11 Dec 2020 8:29 am
by ChaserPeek
Yes Freddie, thanks for you help. Sorry I'm a new user in linux world :D

Code: Select all

root@beaglebone:/home/ubuntu# systemctl status cumulusmx.service
● cumulusmx.service - CumulusMX service
   Loaded: loaded (/etc/systemd/system/cumulusmx.service; enabled; vendor preset
   Active: failed (Result: exit-code) since Thu 2020-12-10 23:10:42 UTC; 8h ago
     Docs: https://cumuluswiki.org/a/Main_Page
  Process: 9240 ExecStopPost=/bin/rm /tmp/CumulusMX.exe.lock (code=exited, statu
  Process: 9239 ExecStart=/usr/bin/mono-service -d:/home/ubuntu/CumulusMX Cumulu

Dec 10 23:10:42 beaglebone systemd[1]: Starting CumulusMX service...
Dec 10 23:10:42 beaglebone systemd[9239]: cumulusmx.service: Failed to execute c
Dec 10 23:10:42 beaglebone systemd[9239]: cumulusmx.service: Failed at step EXEC
Dec 10 23:10:42 beaglebone systemd[1]: cumulusmx.service: Control process exited
Dec 10 23:10:42 beaglebone rm[9240]: /bin/rm: cannot remove '/tmp/CumulusMX.exe.
Dec 10 23:10:42 beaglebone systemd[1]: cumulusmx.service: Control process exited
Dec 10 23:10:42 beaglebone systemd[1]: cumulusmx.service: Failed with result 'ex
Dec 10 23:10:42 beaglebone systemd[1]: Failed to start CumulusMX service.
lines 1-15/15 (END)...skipping...
● cumulusmx.service - CumulusMX service
   Loaded: loaded (/etc/systemd/system/cumulusmx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-12-10 23:10:42 UTC; 8h ago
     Docs: https://cumuluswiki.org/a/Main_Page
  Process: 9240 ExecStopPost=/bin/rm /tmp/CumulusMX.exe.lock (code=exited, status=1/FAILURE)
  Process: 9239 ExecStart=/usr/bin/mono-service -d:/home/ubuntu/CumulusMX CumulusMX.exe -service

Dec 10 23:10:42 beaglebone systemd[1]: Starting CumulusMX service...
Dec 10 23:10:42 beaglebone systemd[9239]: cumulusmx.service: Failed to execute command: No such f
Dec 10 23:10:42 beaglebone systemd[9239]: cumulusmx.service: Failed at step EXEC spawning /usr/bi
Dec 10 23:10:42 beaglebone systemd[1]: cumulusmx.service: Control process exited, code=exited sta
Dec 10 23:10:42 beaglebone rm[9240]: /bin/rm: cannot remove '/tmp/CumulusMX.exe.lock': No such fi
Dec 10 23:10:42 beaglebone systemd[1]: cumulusmx.service: Control process exited, code=exited sta
Dec 10 23:10:42 beaglebone systemd[1]: cumulusmx.service: Failed with result 'exit-code'.
Dec 10 23:10:42 beaglebone systemd[1]: Failed to start CumulusMX service.
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
lines 1-15/15 (END)...skipping...
● cumulusmx.service - CumulusMX service
   Loaded: loaded (/etc/systemd/system/cumulusmx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-12-10 23:10:42 UTC; 8h ago
     Docs: https://cumuluswiki.org/a/Main_Page
  Process: 9240 ExecStopPost=/bin/rm /tmp/CumulusMX.exe.lock (code=exited, status=1/FAILURE)
  Process: 9239 ExecStart=/usr/bin/mono-service -d:/home/ubuntu/CumulusMX CumulusMX.exe -service

Dec 10 23:10:42 beaglebone systemd[1]: Starting CumulusMX service...
Dec 10 23:10:42 beaglebone systemd[9239]: cumulusmx.service: Failed to execute command: No such f
Dec 10 23:10:42 beaglebone systemd[9239]: cumulusmx.service: Failed at step EXEC spawning /usr/bi
Dec 10 23:10:42 beaglebone systemd[1]: cumulusmx.service: Control process exited, code=exited sta
Dec 10 23:10:42 beaglebone rm[9240]: /bin/rm: cannot remove '/tmp/CumulusMX.exe.lock': No such fi
Dec 10 23:10:42 beaglebone systemd[1]: cumulusmx.service: Control process exited, code=exited sta
Dec 10 23:10:42 beaglebone systemd[1]: cumulusmx.service: Failed with result 'exit-code'.
Dec 10 23:10:42 beaglebone systemd[1]: Failed to start CumulusMX service.
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
lines 1-15/15 (END)


and

Code: Select all


root@beaglebone:/home/ubuntu# journalctl -xe
-- Subject: Unit user@1000.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit user@1000.service has finished starting up.
--
-- The start-up result is RESULT.
Dec 11 08:00:30 beaglebone systemd[9599]: Reached target Default.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit UNIT has finished starting up.
--
-- The start-up result is RESULT.
Dec 11 08:00:30 beaglebone systemd[9599]: Startup finished in 228ms.
-- Subject: User manager start-up is now complete
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The user manager instance for user 1000 has been started. All services queued
-- for starting have been started. Note that other services might still be starting
-- up or be started at any later time.
--
-- Startup of the manager took 228274 microseconds.
Dec 11 08:00:42 beaglebone sudo[9623]:   ubuntu : TTY=pts/0 ; PWD=/home/ubuntu ; USER=root ; COMM
Dec 11 08:00:42 beaglebone sudo[9623]: pam_unix(sudo:session): session opened for user root by ub
Dec 11 08:00:42 beaglebone su[9624]: Successful su for root by root
Dec 11 08:00:42 beaglebone su[9624]: + /dev/pts/0 root:root
Dec 11 08:00:42 beaglebone su[9624]: pam_unix(su:session): session opened for user root by ubuntu
Dec 11 08:00:42 beaglebone su[9624]: pam_systemd(su:session): Cannot create session: Already runn
Dec 11 08:11:25 beaglebone connmand[4254]: ntp: adjust (slew): +0.000176 sec
Dec 11 08:17:01 beaglebone CRON[9645]: pam_unix(cron:session): session opened for user root by (u
Dec 11 08:17:01 beaglebone CRON[9646]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly
Dec 11 08:17:01 beaglebone CRON[9645]: pam_unix(cron:session): session closed for user root
Dec 11 08:28:29 beaglebone connmand[4254]: ntp: adjust (slew): -0.000625 sec
lines 2595-2630/2630 (END)



Re: cumulusmx.service

Posted: Fri 11 Dec 2020 11:20 am
by freddie
Could you please post the contents of /etc/systemd/system/cumulusmx.service on here.

Re: cumulusmx.service

Posted: Fri 11 Dec 2020 12:27 pm
by ChaserPeek
Of course.

Code: Select all

[Unit]
Description=CumulusMX service
Documentation=https://cumuluswiki.org/a/Main_Page
After=network-online.target

[Service]
User=root
Group=root
ExecStart=/usr/bin/mono-service -d:/home/ubuntu/CumulusMX CumulusMX.exe -service
Type=forking
ExecStopPost=/bin/rm /tmp/CumulusMX.exe.lock

[Install]
WantedBy=multi-user.target

the code is the same of cumulusmx.service in CumulusMX folder, and I have copied with:

Code: Select all

sudo cp cumulusmx.service /etc/systemd/system/
Sorry for the trivial question: how can I access in the /etc folder directly ? [Solved I access now in /etc folder ] :lol:
thanks

Re: cumulusmx.service

Posted: Fri 11 Dec 2020 12:45 pm
by freddie

Code: Select all

d:/home/ubuntu/CumulusMX
Is CumulusMX installed in this location? If not, you need to change this in cumulusmx.service.

Re: cumulusmx.service

Posted: Fri 11 Dec 2020 12:51 pm
by ChaserPeek
Yesm this is my path

Code: Select all

root@beaglebone:/home/ubuntu/CumulusMX

I'm not completely sure about the path d: . Can I verify this ?

Re: cumulusmx.service

Posted: Fri 11 Dec 2020 1:16 pm
by freddie
d: is just to let systemd know this is the directory where the program you are running is located.

Have you tried running CumulusMX as a service in a terminal?

Re: cumulusmx.service

Posted: Fri 11 Dec 2020 1:47 pm
by ChaserPeek
Sincerely I tried only this:

Code: Select all

sudo systemctl start cumulusmx

can you recommend another way?

Thanks.