Note that RMKilling PlayIt will not fail just because there are still clients registered - it will quit anyway assuming the user is doing do forcibly. It is up to clients to only kill PlayIt when PlayIt agrees else leave it running.
In order for a client to ever be given the go ahead for killing PlayIt it must register itself within a few centiseconds after having loaded it. If the first registration occurs some time after PlayIt has been started then it assumes it was started manually (from the CLI or during boot up) and so should not be killed by any clients that subsequently use it.
So the sequence of action is then:
Startup | Ensure PlayIt is loaded |
Register client (PlayIt_ClientOp,0,0) | |
Quitting | Degresiter client (PlayIt_ClientOp,1) |
If returned R1 is zero then RMKill PlayIt |
[ Parent ] [ Manual root ]