How to properly stop virtualhere client?

I try to use Virtualhere Client in a /etc/init.d script. Starting it is no problem but traditional stop from start-stop-daemon does not work. I have to force kill the process with "kill -9 <client_pid>" to get rid of it.

The problem is that this leaves /tmp/vhclient /tmp/vhclient_response and the folder with the socket /tmp/virtualhere_rpc file laying around. And virtualhere does not like that. If you start the client with those files still containing content. It messes up the commands sent with -t completely. Somehow concatenating whats in /tmp/vhclient with what you sent as command and returning very strange errors mostly that this rpc command does not exist (This is a bug in my eyes, why does virtualhere not clean up those files when it starts).

So I had to implement that those files get cleaned before virtualhere is started, but actually I'd like to now if there's a way to gracefully or let's say properly stop it so that those files are beeing removed when stopped without having to force kill it with -9 but rather -15. But if I try that process keeps running.

#2

Sure, just use the EXIT command

e.g ./vhclientarmhf -t EXIT

#3

I don't know why, but somehow I didn't see the command in the command list. Thanks for pointing it out.