My app is a Web Server. It runs on Windows as a service, on Linux as a daemon. The support for same is inside the app itself. e.g.
MyWebServer -s
Installs and runs it as a service on Windows
MyWebserver -d
Runs it as a daemon on Linux (Though scripts can be used too)
On Mac OS X, all the posts point to
launchctl
which needs a plist xml file
I just want my users to type
sudo ./MyWebServer -s
And it should automatically install the MyWebServer instance as a "launchd" daemon set to start with the computer and run silently in the background.
I have seen some apps doing that without any plist xml file. How to add the support for same from within the app. My server is written in C/C++
Edit: I don't want to use fork method in OS X instead the recommended launchd daemon