Start && stop worker service at runtime from MAUI

Dani_S 3,316 Reputation points
2022-05-02T03:32:46.62+00:00

Hi,
Worker service is cross platform.
We can start/stop worker service on window from MAUI app using ServiceController.
How is done with Linux and Mac? which package can start/stop worker service from MAUI app.
Thanks,

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,207 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,140 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,186 Reputation points
    2022-05-03T15:24:16.733+00:00

    in MacOs and linux world you create daemons, not services.

    macOs daemon

    https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html

    linux daemon

    http://shahmirj.com/blog/beginners-guide-to-creating-a-daemon-in-linux

    on MacOs (and freebsd), you configure launchd with launchctl

    https://www.launchd.info
    https://ss64.com/osx/launchctl.html

    on linux it will depend on the distro used. some use service, but others use systemd

    https://man7.org/linux/man-pages/man5/systemd.service.5.html
    https://www.linux.com/training-tutorials/understanding-and-using-systemd/

    note: on MacOs and Linux, you'd typically fork, and run a configuration utility rather than call a library to configure startup applications. Often this is done by the installation script.

    0 comments No comments