I have a service that I would like to manage through systemd - let's call it
foo. I wrote unit files, and they're working just fine. So, if I run
systemctl start foo, the service starts correctly, and I can see its status with
systemctl status foo.
However, an external program may also start the service, and it doesn't use systemd to start the service. So, the service can be running, but since it wasn't started through systemd, systemd doesn't know about it. In this case,
systemctl status foo reports that the service has failed, even though its running correctly.
Is there a way to have systemd 'inherit' or 'adopt' this service, so
systemctl status foo correctly reports that the service is running, even when systemd didn't start it? With SysV, I would write a small 'status' script, so I could
/etc/init.d/foo status, but that doesn't seem to fit with the systemd model.
To be clear, when the external program starts the service, the service's processes are still children of PID 1/systemd. But, systemd doesn't recognize them as part of service
foo, since systemd didn't start and register them.
The specific technologies are:
- Oracle WebLogic (the service is a Managed WebLogic Instance)
- Oracle NodeManager (this is the external program that may also start the service)
- systemd 219