I don't know if it is appropriate or not, but I used the sd-bus library.
I just ask systemd if my service is running. If it is running I then
get the service's MainPID. If the mainPID matches my process pid then
I started from the systemd. If not then I didn't.
I only use it for debugging. If I s
I am beginning to use the sd-bus library. I have been able to get a couple of
properties, MainPID and SubState.
I would like to use the Stop method. I am using cups as an example. This
commands shows that in thee Unit interface there is a Start and Stop method:
$ busctl introspect org.freedesk