Is there a tool which can control daemons/services in a cross-platform manner?
In programming there are different build tools that allow you to build software from source on different platforms; the tool will take care of detecting the capabilities of the particular machine and locate libraries, compilers, etc. CMake is an example.
There's a similar problem with controlling daemon's. Depending on the OS, if I want to start a daemon I might use
stop-start-daemon -S mydaemon
or perhaps call a script like
/etc/init.d/mydaemon start
or if systemctl
is the tool of choice then
systemctl start mydaemon
And if I'm on Windows then I could use either net start myservice
or sc start myservice
.
Is there a tool, script, or other canonical method for handling this scenario? I don't need fine-grained control; just stop and start, but I'd like to be able to deploy my own software on multiple systems using the same script.