Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Staring An Program At Boot

3 views
Skip to first unread message

Dr Stephen Strange

unread,
May 10, 2023, 3:21:00 AM5/10/23
to
I am running the CumuusMX weather program on an Mac Mini.

https://www.cumuluswiki.org/a/Software

It runs under Mono

https://www.mono-project.com/docs/getting-started/install/mac/

And I have it up and running.

To make it start on boot I have wriiten a very small bash script

cd /Users/username/CumulusMXD
/Library/Frameworks/Mono.framework/Versions/Current/bin/mono CumulusMX.exe

Then I have used Automatator as here

https://stackoverflow.com/questions/6442364/running-script-upon-login-in-mac-os-x/6445525#6445525

And added the result to login items.

This works but is there a better way?

When instaled under Linux I can install it as a service and use
systemctl start cumulusmx for example to contol it.

Is there I way I can do this on the Mac.

If so can someone point me to (simple) instuctions!

Alan Browne

unread,
May 10, 2023, 10:34:16 AM5/10/23
to
The simplest way to do that is to add the program to the login items.

I infer that mono is in the way?

Can the desired program be obtained already compiled for Mac OS?

Otherwise your script solution seems to be fine.

--
“Donald Trump and his allies and supporters are a clear and present
danger to American democracy.”
- J Michael Luttig - 2022-06-16
- Former US appellate court judge (R) testifying to the January 6
committee

Benjamin Esham

unread,
May 10, 2023, 10:35:47 AM5/10/23
to
Dr Stephen Strange wrote:

> I am running the CumuusMX weather program on an Mac Mini.
>
> [snip]
>
> To make it start on boot I have wriiten a very small bash script
>
> cd /Users/username/CumulusMXD
> /Library/Frameworks/Mono.framework/Versions/Current/bin/mono CumulusMX.exe
>
> Then I have used Automatator as here
>
> https://stackoverflow.com/questions/6442364/running-script-upon-login-in-mac-os-x/6445525#6445525
>
> And added the result to login items.
>
> This works but is there a better way?

The "Right Way" to do this kind of thing on a Mac is to use launchd, which
is the Mac equivalent of systemd. (Or at least the "launch programs under
certain conditions" part of systemd.) That Stack Overflow answer actually
points to this solution when it says, "the cleanest way to run any program
or shell script at login time is described in @trisweb's answer". The answer
in question is at [1], and IMO it gives a reasonable summary of what you
need to do to launch your program through launchd.

If you find yourself dealing with launchd more than occasionally, I highly
recommend using LaunchControl [2], which is a GUI that shows all of the
launchd agents and daemons you have running and allows you to modify them,
with more guardrails and sanity checking than you'd have if you were just
editing the XML files by hand.

Hope this helps!

Benjamin

[1] https://stackoverflow.com/a/13372744/371228

[2] https://soma-zone.com/LaunchControl/

Jolly Roger

unread,
May 10, 2023, 11:30:10 AM5/10/23
to
This is the correct answer. And I also recommend using a GUI utility to
do it if you are unfamiliar with launchd (and even if you are).

I've used another GUI launchd utility called Lingon [3] for years. I
wonder how it compares to LaunchControl.

[3] https://www.peterborgapps.com/lingon/

--
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

Dr Stephen Strange

unread,
May 11, 2023, 2:51:54 AM5/11/23
to
Many thanks for all the advice
0 new messages